[FFmpeg-devel] [PATCH 17/23] avfilter/vf_mergeplanes: Free inpads' names generically

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Aug 12 04:43:51 EEST 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/vf_mergeplanes.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_mergeplanes.c b/libavfilter/vf_mergeplanes.c
index 30888f62af..633421e37d 100644
--- a/libavfilter/vf_mergeplanes.c
+++ b/libavfilter/vf_mergeplanes.c
@@ -96,10 +96,8 @@ static av_cold int init(AVFilterContext *ctx)
         if (!pad.name)
             return AVERROR(ENOMEM);
 
-        if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0){
-            av_freep(&pad.name);
+        if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0)
             return ret;
-        }
     }
 
     return 0;
@@ -279,12 +277,8 @@ static int activate(AVFilterContext *ctx)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     MergePlanesContext *s = ctx->priv;
-    int i;
 
     ff_framesync_uninit(&s->fs);
-
-    for (i = 0; i < ctx->nb_inputs; i++)
-        av_freep(&ctx->input_pads[i].name);
 }
 
 static const AVFilterPad mergeplanes_outputs[] = {
@@ -308,4 +302,5 @@ const AVFilter ff_vf_mergeplanes = {
     .inputs        = NULL,
     .outputs       = mergeplanes_outputs,
     .flags         = AVFILTER_FLAG_DYNAMIC_INPUTS,
+    .flags_internal = FF_FILTER_FLAG_FREE_INPADS,
 };
-- 
2.30.2



More information about the ffmpeg-devel mailing list