summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-26 17:55:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-26 17:55:01 +0100
commit61c2cec9579b5a24e95102b137eab3ecc6902d15 (patch)
tree330a6bf7db597e9ab8ab5417ff446f8cef2c2ce0 /libavcodec/pthread.c
parentcb8db6423ae9b454944b150b564d079f46276f01 (diff)
downloadffmpeg-61c2cec9579b5a24e95102b137eab3ecc6902d15.tar.gz
pthreads: fix segfault due to the thread beimg killed before it has been allocated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 eb304720e4..e3815ba6d3 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -658,7 +658,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);