diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c index 9e1ae79e00..f418c6fba8 100644 --- a/libavfilter/vf_mix.c +++ b/libavfilter/vf_mix.c @@ -289,7 +289,7 @@ static av_cold void uninit(AVFilterContext *ctx) for (i = 0; i < ctx->nb_inputs; i++) av_freep(&ctx->input_pads[i].name); } else { - for (i = 0; i < s->nb_frames; i++) + for (i = 0; i < s->nb_frames && s->frames; i++) av_frame_free(&s->frames[i]); } av_freep(&s->frames);