[FFmpeg-cvslog] mpegvideo: dont leave stale pointers in next/last picture
Michael Niedermayer
git at videolan.org
Sat Jan 12 05:09:33 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 12 04:45:21 2013 +0100| [d9226b3717fda04c5cde8f51c4dc85fa735b1909] | committer: Michael Niedermayer
mpegvideo: dont leave stale pointers in next/last picture
Fixes out of array reads
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=d9226b3717fda04c5cde8f51c4dc85fa735b1909
---
libavcodec/mpegvideo.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4609b0b..4fd8062 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -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)
More information about the ffmpeg-cvslog
mailing list