diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index c8602626b5..b1b2cbc21a 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -186,7 +186,10 @@ static av_cold int init(AVFilterContext *ctx) return AVERROR(ENOMEM); pad.type = ctx->filter->inputs[0].type; pad.request_frame = request_frame; - ff_insert_outpad(ctx, i, &pad); + if ((ret = ff_insert_outpad(ctx, i, &pad)) < 0) { + av_freep(&pad.name); + return ret; + } } return 0;