diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 3364376a6675567850f33254de18dbb6889e521c..dae28e6f5e6faaddc9eb90f4f5d5108b7c298f33 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);