]> git.sesse.net Git - ffmpeg/commitdiff
fftools/ffmpeg: Fix leak of AVFilterInOut in case of error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 23 Aug 2020 01:49:48 +0000 (03:49 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 23 Aug 2020 17:57:42 +0000 (19:57 +0200)
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 <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
fftools/ffmpeg.c

index 173ac3c9a0e7e215b7601f44bc14a41679d09ee6..84306818a26ab4b94e07f1e7cd02a81742c1940a 100644 (file)
@@ -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);