summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-17 22:45:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-17 23:43:35 +0100
commite1d7d4bd13cdd8856a3611d1ea387ac733a7aebf (patch)
tree92865173421083fad645da8e7997a23ff3cce47e /libavcodec/mpegvideo.c
parent9a038a95d2769d8a4cfa08dff88d7484bf69549d (diff)
mpegvideo: reset context state on failed thread update.
Fixes assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 90c0bbfdd9..d4d913b053 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -584,8 +584,11 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
if (s1->context_initialized){
s->picture_range_start += MAX_PICTURE_COUNT;
s->picture_range_end += MAX_PICTURE_COUNT;
- if((err = ff_MPV_common_init(s)) < 0)
+ if((err = ff_MPV_common_init(s)) < 0){
+ memset(s, 0, sizeof(MpegEncContext));
+ s->avctx = dst;
return err;
+ }
}
}