diff --git a/libavcodec/vvc/vvcdec.c b/libavcodec/vvc/vvcdec.c index f024cbd067..570e2aa513 100644 --- a/libavcodec/vvc/vvcdec.c +++ b/libavcodec/vvc/vvcdec.c @@ -950,13 +950,14 @@ static av_cold void vvc_decode_flush(AVCodecContext *avctx) { VVCContext *s = avctx->priv_data; int got_output = 0; - VVCFrameContext *last; while (s->nb_delayed) wait_delayed_frame(s, NULL, &got_output); - last = get_frame_context(s, s->fcs, s->nb_frames - 1); - ff_vvc_flush_dpb(last); + if (s->fcs) { + VVCFrameContext *last = get_frame_context(s, s->fcs, s->nb_frames - 1); + ff_vvc_flush_dpb(last); + } s->eos = 1; }