Commit e1d7d4bd authored by Michael Niedermayer's avatar Michael Niedermayer

mpegvideo: reset context state on failed thread update.

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9a038a95
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment