[FFmpeg-cvslog] avcodec/vc1dec: dont calculate unused values from uninitialized sprites

Michael Niedermayer git at videolan.org
Sat Dec 14 01:56:53 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 14 00:58:18 2013 +0100| [cf95dee3de5930172900ef36e376c8a7f31988bc] | committer: Michael Niedermayer

avcodec/vc1dec: dont calculate unused values from uninitialized sprites

Fixes use of uninitialized data
Fixes part of msan_uninit-mem_7f51a8b0b3b0_1009_Arlington.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf95dee3de5930172900ef36e376c8a7f31988bc
---

 libavcodec/vc1dec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 8784644..edddc48 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5364,7 +5364,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
     int ysub[2];
     MpegEncContext *s = &v->s;
 
-    for (i = 0; i < 2; i++) {
+    for (i = 0; i <= v->two_sprites; i++) {
         xoff[i] = av_clip(sd->coefs[i][2], 0, v->sprite_width-1 << 16);
         xadv[i] = sd->coefs[i][0];
         if (xadv[i] != 1<<16 || (v->sprite_width << 16) - (v->output_width << 16) - xoff[i])
@@ -5442,7 +5442,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
         }
 
         if (!plane) {
-            for (i = 0; i < 2; i++) {
+            for (i = 0; i <= v->two_sprites; i++) {
                 xoff[i] >>= 1;
                 yoff[i] >>= 1;
             }



More information about the ffmpeg-cvslog mailing list