diff mbox series

[FFmpeg-devel,19/23] avfilter/vf_program_opencl: Free inpads' names generically

Message ID PR3PR03MB6665A060F27E6510BC466F088FF99@PR3PR03MB6665.eurprd03.prod.outlook.com
State Superseded
Headers show
Series [FFmpeg-devel,01/23] avfilter/vf_(guided|program_opencl): Add missing dynamic inputs flag | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 12, 2021, 1:43 a.m. UTC
Only ff_vf_program_opencl is affected by this: ff_vsrc_openclsrc
as a source filter doesn't have any inputs and the code where inpads
are inserted is unreachable for it.

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

Patch

diff --git a/libavfilter/vf_program_opencl.c b/libavfilter/vf_program_opencl.c
index 5f455e9afa..c4f4acb919 100644
--- a/libavfilter/vf_program_opencl.c
+++ b/libavfilter/vf_program_opencl.c
@@ -288,10 +288,8 @@  static av_cold int program_opencl_init(AVFilterContext *avctx)
             input.config_props = &ff_opencl_filter_config_input;
 
             err = ff_insert_inpad(avctx, i, &input);
-            if (err < 0) {
-                av_freep(&input.name);
+            if (err < 0)
                 return err;
-            }
         }
     }
 
@@ -302,14 +300,11 @@  static av_cold void program_opencl_uninit(AVFilterContext *avctx)
 {
     ProgramOpenCLContext *ctx = avctx->priv;
     cl_int cle;
-    int i;
 
     if (ctx->nb_inputs > 0) {
         ff_framesync_uninit(&ctx->fs);
 
         av_freep(&ctx->frames);
-        for (i = 0; i < avctx->nb_inputs; i++)
-            av_freep(&avctx->input_pads[i].name);
     }
 
     if (ctx->kernel) {
@@ -375,7 +370,7 @@  const AVFilter ff_vf_program_opencl = {
     .activate       = &program_opencl_activate,
     .inputs         = NULL,
     .outputs        = program_opencl_outputs,
-    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE | FF_FILTER_FLAG_FREE_INPADS,
 };
 
 #endif