diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-17 22:45:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-17 23:43:35 +0100 |
commit | e1d7d4bd13cdd8856a3611d1ea387ac733a7aebf (patch) | |
tree | 92865173421083fad645da8e7997a23ff3cce47e | |
parent | 9a038a95d2769d8a4cfa08dff88d7484bf69549d (diff) | |
download | ffmpeg-e1d7d4bd13cdd8856a3611d1ea387ac733a7aebf.tar.gz |
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>
-rw-r--r-- | libavcodec/mpegvideo.c | 5 |
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; + } } } |