提交 ff8329a7 编写于 作者: J Jun Zhao

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: NJun Zhao <barryjzhao@tencent.com>
上级 77e15f01
...@@ -876,6 +876,12 @@ static av_cold int init(AVFilterContext *ctx) ...@@ -876,6 +876,12 @@ static av_cold int init(AVFilterContext *ctx)
if (!pad.name) if (!pad.name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ret = ff_insert_outpad(ctx, 0, &pad);
if (ret < 0) {
av_freep(&pad.name);
return ret;
}
if (s->response) { if (s->response) {
vpad = (AVFilterPad){ vpad = (AVFilterPad){
.name = av_strdup("filter_response"), .name = av_strdup("filter_response"),
...@@ -884,15 +890,7 @@ static av_cold int init(AVFilterContext *ctx) ...@@ -884,15 +890,7 @@ static av_cold int init(AVFilterContext *ctx)
}; };
if (!vpad.name) if (!vpad.name)
return AVERROR(ENOMEM); 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); ret = ff_insert_outpad(ctx, 1, &vpad);
if (ret < 0) { if (ret < 0) {
av_freep(&vpad.name); av_freep(&vpad.name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册