diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 1240abbde2..38e39d68af 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -2841,8 +2841,10 @@ static int fg_output_step(OutputFilterPriv *ofp, FilterGraphThread *fgt, if (!fgt->got_frame) { ret = clone_side_data(&fd->side_data, &fd->nb_side_data, ofp->side_data, ofp->nb_side_data, 0); - if (ret < 0) + if (ret < 0) { + av_frame_unref(frame); return ret; + } } fd->wallclock[LATENCY_PROBE_FILTER_POST] = av_gettime_relative();