[FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: Check for FF_SANE_NB_CHANNELS
Anton Khirnov
anton at khirnov.net
Fri Sep 20 11:52:22 EEST 2024
Quoting Michael Niedermayer (2024-09-17 19:59:53)
> 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 ?
Depends on how it is done. I do NOT agree with ad-hoc checks scattered
across random demuxers.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list