[FFmpeg-devel] [PATCH 1/3] avcodec/alsdec: Limit maximum channels to 64

Michael Niedermayer michael at niedermayer.cc
Tue Aug 20 17:52:19 EEST 2019


On Tue, Aug 20, 2019 at 09:12:36AM +0200, Thilo Borgmann wrote:
> Am 19.08.19 um 23:22 schrieb Michael Niedermayer:
> > On Mon, Aug 19, 2019 at 05:09:37PM +0200, Thilo Borgmann wrote:
> >> Am 19.08.19 um 14:27 schrieb Michael Niedermayer:
> >>> On Mon, Aug 19, 2019 at 07:41:43AM +0200, Thilo Borgmann wrote:
> >>>> Am 19.08.19 um 01:30 schrieb Michael Niedermayer:
> >>>>> There seems to be no limit in the specification and upto 64k could be stored
> >>>>> 64 is chooses as limit as thats also used for AAC and is what a int64 mask
> >>>>> can handle
> >>>>>
> >>>>> An alternative to this patch would be a max_channels variable
> >>>>
> >>>> There's a conformance file containing 512 channels, that should be the default max value.
> >>>
> >>> will apply with that value later
> >>
> >> Decoding of that is already stopped via FF_SANE_NB_CHANNELS in lavc/internal.h.
> >> That is currently set to 256U. I guess pushing that to 512U might already be enough without any change to single decoders?
> > 
> > the problem of out of memory is that the als decoder allocates some pretty
> > large things per channel. A check on channels needs to happen before
> > this.
> > The existing checks didnt achieve that.
> > 
> > I can of course post a patchset that uses FF_SANE_NB_CHANNELS in als and
> > bump it to the next number if people prefer this ?
> > 
> > Note though that increasing FF_SANE_NB_CHANNELS may also increase timeouts
> > in other decoders.
> 
> I see the problem.
> However, right now alsdec is fine with any number of channels and the CLI prevents decoding anything above FF_SANE_NB_CHANNELS (checks are in lavc/decoding.c and lavc/utils.c; this would also stop any FATE test on 512 channels file).
> 
> So having alsdec check for a value higher than FF_SANE_NB_CHANNELS (like 512) would have no effect for CLI users, right?

yes, just wanted to make sure the side effect of a 512 FF_SANE_NB_CHANNELS is
understood

will post the patches

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190820/71e9f955/attachment.sig>


More information about the ffmpeg-devel mailing list