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>
pull/8/head
Michael Niedermayer 12 years ago
parent 9a038a95d2
commit e1d7d4bd13
  1. 5
      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;
}
}
}

Loading…
Cancel
Save