aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-09-15 20:03:40 +0200
committerPaul B Mahol <onemda@gmail.com>2018-09-15 21:59:01 +0200
commitda7a0ac979bb71fcb3e9bbbe08f27238379d12da (patch)
treeb03ae4e510b3b3c3cb9d471c4e108c196389200b
parent28b80c2d52d82eb4f73af5f818dab60946bcf299 (diff)
downloadffmpeg-da7a0ac979bb71fcb3e9bbbe08f27238379d12da.tar.gz
avfilter/af_afir: check return value of ff_insert_outpad()
-rw-r--r--libavfilter/af_afir.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index a4a7160de1..ac23100aab 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -631,9 +631,8 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->fdsp);
- av_freep(&ctx->output_pads[0].name);
- if (s->response)
- av_freep(&ctx->output_pads[1].name);
+ for (int i = 0; i < ctx->nb_outputs; i++)
+ av_freep(&ctx->output_pads[i].name);
av_frame_free(&s->video);
}
@@ -658,6 +657,7 @@ static av_cold int init(AVFilterContext *ctx)
{
AudioFIRContext *s = ctx->priv;
AVFilterPad pad, vpad;
+ int ret;
pad = (AVFilterPad){
.name = av_strdup("default"),
@@ -679,10 +679,19 @@ static av_cold int init(AVFilterContext *ctx)
return AVERROR(ENOMEM);
}
- ff_insert_outpad(ctx, 0, &pad);
+ ret = ff_insert_outpad(ctx, 0, &pad);
+ if (ret < 0) {
+ av_freep(&pad.name);
+ return ret;
+ }
- if (s->response)
- ff_insert_outpad(ctx, 1, &vpad);
+ if (s->response) {
+ ret = ff_insert_outpad(ctx, 1, &vpad);
+ if (ret < 0) {
+ av_freep(&vpad.name);
+ return ret;
+ }
+ }
s->fcmul_add = fcmul_add_c;