[FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: Check for FF_SANE_NB_CHANNELS

Michael Niedermayer michael at niedermayer.cc
Tue Sep 17 20:59:53 EEST 2024


On Sun, Sep 15, 2024 at 09:09:39PM +0200, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2024-09-13 19:48:46)
[...]
> > > 
> > > > +#include "libavcodec/internal.h"
> > > 
> > > I dislike this as well.
> > 
> > I am fine with it.
> > 
> > But if you dont, then maybe you can suggest another way to check
> > for the number that we support.
> 
> My second objection, in case it is not clear, is to libavformat
> including libavcodec internal headers that define libavcodec internal
> structures. That is a slippery slope that easily leads to people
> actually accessing those internal structures.
> 

> But also the number 512 is entirely arbitrary, and if we decide to
> arbitrarily restrict the channel count everywhere then it should be done
> at the level of AVChannelLayout. E.g. by making nb_channels and uint8 or
> uint16, and/or adding the check to av_channel_layout_check().

Now that this specific issue is fixed by james patch.
Would you agree that the more general issue of "something" allocating
and or processing a large number of channels can be checked for ?
And that the constant would then of course be moved to libavutil

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240917/e7abc8c9/attachment.sig>


More information about the ffmpeg-devel mailing list