Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
---
It is not intended for these added lines to live very long: One can add
flags to AVFilter.flags_internal that indicate that this filter wants
the inpads/outpads' names be freed generically. This will allow to
remove most of the code for freeing in/outpads. These flags can also be
used to make ff_insert_in/outpad free the name itself upon error.

Furthermore, one can make ff_insert_pad() return AVERROR(ENOMEM) if the
name of the pad that is about to be inserted is NULL; this allows to
remove the checks for allocation failure from the callers.

 libavfilter/vf_signature.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 5ea55d5247..d09003746c 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -730,6 +730,8 @@ static av_cold void uninit(AVFilterContext *ctx)
         }
         av_freep(&sic->streamcontexts);
     }
+    for (unsigned i = 0; i < ctx->nb_inputs; i++)
+        av_freep(&ctx->input_pads[i].name);
 }
 
 static int config_output(AVFilterLink *outlink)
-- 
2.20.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to