[FFmpeg-cvslog] mpegvideo: reset context state on failed thread update.

Michael Niedermayer git at videolan.org
Thu Jan 17 23:44:18 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 17 22:45:12 2013 +0100| [e1d7d4bd13cdd8856a3611d1ea387ac733a7aebf] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1d7d4bd13cdd8856a3611d1ea387ac733a7aebf
---

 libavcodec/mpegvideo.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 90c0bbf..d4d913b 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;
+            }
         }
     }
 



More information about the ffmpeg-cvslog mailing list