[FFmpeg-devel] [PATCH] lavfi: check the validity of formats lists.

Nicolas George george at nsup.org
Thu Aug 13 17:20:05 EEST 2020


Andreas Rheinhardt (12020-08-13):
> Which part of the code fails if there are duplicates?

At least the merge loops. They can be protected, but the result is still
invalid and should be avoided, preferably with useful diagnostic.

> ff_merge_channel_layouts() can be easily fixed by adding breaks to all
> loops, so if it is only this, we could forgo checking as its cost is
> quadratic in the number of elements.

The merges are quadratic too, this is just changing the constant.

We could avoid all quadratic operations by sorting the list. If we
decide to do so, these check functions are good candidates to be renamed
"prepare" or "optimize" and do it.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200813/8e982605/attachment.sig>


More information about the ffmpeg-devel mailing list