From a23078a721682268caf03fc6d24a6ab202d309ae Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 23 Aug 2020 03:49:48 +0200 Subject: [PATCH] fftools/ffmpeg: Fix leak of AVFilterInOut in case of error The AVFilterInOuts normally get freed in init_output_filter() when the corresponding streams get created; yet if an error happens before one reaches said point, they leak. Therefore this commit makes ffmpeg_cleanup free them, too. Fixes ticket #8267. Reviewed-by: Nicolas George Signed-off-by: Andreas Rheinhardt (cherry picked from commit 426c16d61a9b5056a157a1a2a057a4e4d13eef84) --- fftools/ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 2e9448ea2b..a92c7f20ef 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -528,6 +528,7 @@ static void ffmpeg_cleanup(int ret) for (j = 0; j < fg->nb_outputs; j++) { OutputFilter *ofilter = fg->outputs[j]; + avfilter_inout_free(&ofilter->out_tmp); av_freep(&ofilter->name); av_freep(&ofilter->formats); av_freep(&ofilter->channel_layouts);