From c4b6d0da3865d49c5c3df78902f6c4cc51cbcdbf Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 3 May 2024 23:32:52 +0200 Subject: [PATCH] f_lavfi: reject filters with too many in/outs The pad count serves as a minimum even if the filter has dynamic inputs/outputs, so we should reject them here. At least on FFmpeg 6.1 this results in no practical change in the list accepted filters. fixes: 8bf3fe7e2a05809103527fa3d2a0fd8eeed3ef2a --- filters/f_lavfi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c index afc9f2d445cc5..982e7ea6fa548 100644 --- a/filters/f_lavfi.c +++ b/filters/f_lavfi.c @@ -987,6 +987,8 @@ static bool is_usable(const AVFilter *filter, int media_type) int nb_inputs = avfilter_pad_count(filter->inputs), nb_outputs = avfilter_pad_count(filter->outputs); #endif + if (nb_inputs > 1 || nb_outputs > 1) + return false; bool input_ok = filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS; bool output_ok = filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS; if (nb_inputs == 1)