Commit 61c2cec9 authored by Michael Niedermayer's avatar Michael Niedermayer

pthreads: fix segfault due to the thread beimg killed before it has been allocated

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent cb8db642
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment