]> git.sesse.net Git - ffmpeg/commitdiff
mpegvideo: dont leave stale pointers in next/last picture
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Jan 2013 03:45:21 +0000 (04:45 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Jan 2013 03:46:08 +0000 (04:46 +0100)
Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegvideo.c

index 4609b0b7314efc773ec3310f8cad82870da5ee90..4fd8062a0b1f45be6ab9d0b43988e7f5f6c5a380 100644 (file)
@@ -1496,6 +1496,8 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
         }
     }
 
+    memset(s->last_picture.f.data, 0, sizeof(s->last_picture.f.data));
+    memset(s->next_picture.f.data, 0, sizeof(s->next_picture.f.data));
     if (s->last_picture_ptr)
         ff_copy_picture(&s->last_picture, s->last_picture_ptr);
     if (s->next_picture_ptr)