@@ -125,10 +125,8 @@ static av_cold int init(AVFilterContext *ctx)
if (!pad.name)
return AVERROR(ENOMEM);
- if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
- av_freep(&pad.name);
+ if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0)
return ret;
- }
}
}
@@ -303,10 +301,7 @@ static av_cold void uninit(AVFilterContext *ctx)
ff_framesync_uninit(&s->fs);
av_freep(&s->weights);
- if (!s->tmix) {
- for (i = 0; i < ctx->nb_inputs; i++)
- av_freep(&ctx->input_pads[i].name);
- } else {
+ if (s->tmix) {
for (i = 0; i < s->nb_frames && s->frames; i++)
av_frame_free(&s->frames[i]);
}
@@ -370,6 +365,7 @@ const AVFilter ff_vf_mix = {
.activate = activate,
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_SLICE_THREADS |
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
+ .flags_internal = FF_FILTER_FLAG_FREE_INPADS,
.process_command = process_command,
};
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavfilter/vf_mix.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)