diff options
author | Jun Zhao <barryjzhao@tencent.com> | 2020-05-25 08:48:12 +0800 |
---|---|---|
committer | Jun Zhao <barryjzhao@tencent.com> | 2020-05-30 19:02:34 +0800 |
commit | ff8329a73054bc6055a69860507fe45386e94798 (patch) | |
tree | f67285d82a3f6a4b657185d1c0d7a46acd4c0ff0 /libavfilter | |
parent | 77e15f01fb876561054376c11b1529b202f8130d (diff) | |
download | ffmpeg-ff8329a73054bc6055a69860507fe45386e94798.tar.gz |
lavfi/afir: fix vpad.name leak
Fix vpad.name leak in error path, move the vpad related operation
only if enabled show IR frequency response.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_afir.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 7c7e8458d4..5ba880f10b 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -876,6 +876,12 @@ static av_cold int init(AVFilterContext *ctx) if (!pad.name) return AVERROR(ENOMEM); + ret = ff_insert_outpad(ctx, 0, &pad); + if (ret < 0) { + av_freep(&pad.name); + return ret; + } + if (s->response) { vpad = (AVFilterPad){ .name = av_strdup("filter_response"), @@ -884,15 +890,7 @@ static av_cold int init(AVFilterContext *ctx) }; if (!vpad.name) return AVERROR(ENOMEM); - } - ret = ff_insert_outpad(ctx, 0, &pad); - if (ret < 0) { - av_freep(&pad.name); - return ret; - } - - if (s->response) { ret = ff_insert_outpad(ctx, 1, &vpad); if (ret < 0) { av_freep(&vpad.name); |