fftools/ffmpeg_filter: fix frame reference leak in fg_output_step

When clone_side_data() fails in fg_output_step(), the function returns
without calling av_frame_unref(frame), leaking the frame reference.
This commit is contained in:
jiangjie
2026-05-13 20:37:15 +08:00
committed by jiangjie
parent 7e045dfbfc
commit 8ffaead836
+3 -1
View File
@@ -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();