summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorCheng Sun <cheng.sun@ymail.com>2011-11-26 10:45:36 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2011-11-26 10:46:08 -0800
commite524eadbf8ac568fcab7fa8f9520fad013beb91a (patch)
tree8a727d1eef42cec01df6aa48ee6e011d24342015 /libavcodec/pthread.c
parent3d1af11df49c9bd27f6677ec2fa327b379144e11 (diff)
[PATCH] Fix crash when initializing multi-threaded decoding for corrupted file.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c3
1 files changed, 2 insertions, 1 deletions
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);