[PATCH] Fix crash when initializing multi-threaded decoding for corrupted file.
authorCheng Sun <cheng.sun@ymail.com>
Sat, 26 Nov 2011 18:45:36 +0000 (10:45 -0800)
committerRonald S. Bultje <rsbultje@gmail.com>
Sat, 26 Nov 2011 18:46:08 +0000 (10:46 -0800)
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
libavcodec/pthread.c

index 3364376..dae28e6 100644 (file)
@@ -651,7 +651,8 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count)
         pthread_cond_signal(&p->input_cond);
         pthread_mutex_unlock(&p->mutex);
 
-        pthread_join(p->thread, NULL);
+        if (p->thread)
+            pthread_join(p->thread, NULL);
 
         if (codec->close)
             codec->close(p->avctx);