pthread: prevent updating AVCodecContext from itself in frame_thread_free
authorRonald S. Bultje <rsbultje@gmail.com>
Fri, 14 Oct 2011 21:47:45 +0000 (23:47 +0200)
committerJanne Grunau <janne-libav@jannau.net>
Fri, 14 Oct 2011 22:13:21 +0000 (00:13 +0200)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavcodec/pthread.c

index 94df4ec..42f4382 100644 (file)
@@ -633,7 +633,7 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count)
 
     park_frame_worker_threads(fctx, thread_count);
 
-    if (fctx->prev_thread)
+    if (fctx->prev_thread && fctx->prev_thread != fctx->threads)
         update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
 
     fctx->die = 1;