Skip to content

Commit

Permalink
f_lavfi: reject filters with too many in/outs
Browse files Browse the repository at this point in the history
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: 8bf3fe7
  • Loading branch information
sfan5 committed May 4, 2024
1 parent 637bc69 commit c4b6d0d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions filters/f_lavfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c4b6d0d

Please sign in to comment.