diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 4d1702e114838aadf99c57c54ce271d7079770c1..0e318a50b1ac8ea010ab41f625a9d84ac910548b 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -557,7 +557,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; if (avctx->active_thread_type & FF_THREAD_FRAME && !h->avctx->hwaccel && - i >= nals_needed && !h->setup_finished) { + i >= nals_needed && !h->setup_finished && h->cur_pic_ptr) { ff_thread_finish_setup(avctx); h->setup_finished = 1; }