diff mbox series

[FFmpeg-devel,5/7] fftools/ffmpeg: Fix leak of AVFilterInOut in case of error

Message ID 20200823095039.18851-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 426c16d61a9b5056a157a1a2a057a4e4d13eef84
Headers show
Series [FFmpeg-devel,1/3] avfilter/graphparser: Fix leaks when parsing inputs fails | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 23, 2020, 9:50 a.m. UTC
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.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 fftools/ffmpeg.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Nicolas George Aug. 23, 2020, 10:12 a.m. UTC | #1
Andreas Rheinhardt (12020-08-23):
> 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.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  fftools/ffmpeg.c | 1 +
>  1 file changed, 1 insertion(+)

LGTM.

Regards,
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 173ac3c9a0..84306818a2 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);