summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-12 04:45:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-12 04:46:08 +0100
commitd9226b3717fda04c5cde8f51c4dc85fa735b1909 (patch)
tree442d8d7fc752480e1759d9752bffccbb236a522c
parentcc548ea7a60355e15ed78431a55a896db074aa11 (diff)
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@gmx.at>
-rw-r--r--libavcodec/mpegvideo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4609b0b731..4fd8062a0b 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)