From e524eadbf8ac568fcab7fa8f9520fad013beb91a Mon Sep 17 00:00:00 2001 From: Cheng Sun Date: Sat, 26 Nov 2011 10:45:36 -0800 Subject: [PATCH] [PATCH] Fix crash when initializing multi-threaded decoding for corrupted file. Signed-off-by: Ronald S. Bultje --- libavcodec/pthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 3364376a66..dae28e6f5e 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -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);