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: 8bf3fe7e2a
This commit is contained in:
sfan5 2024-05-03 23:32:52 +02:00
parent 637bc6994f
commit c4b6d0da38
1 changed files with 2 additions and 0 deletions

View File

@ -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)