[FFmpeg-cvslog] r21170 - trunk/libavcodec/alsdec.c

Reimar Döffinger Reimar.Doeffinger
Tue Jan 12 21:46:28 CET 2010


On Tue, Jan 12, 2010 at 09:41:12PM +0100, Reimar D?ffinger wrote:
> On Tue, Jan 12, 2010 at 08:37:25PM +0000, M?ns Rullg?rd wrote:
> > thilo.borgmann <subversion at mplayerhq.hu> writes:
> > 
> > > Author: thilo.borgmann
> > > Date: Tue Jan 12 21:35:22 2010
> > > New Revision: 21170
> > >
> > > Log:
> > > Replace variable length array with an allocated buffer
> > > in the context to increase compatibility.
> > 
> > What is the maximum size of that anyway?
> 
> According to the documentation just below 4kB.
> While it shouldn't be put on the stack, I'd suggest just adding
> it into the context with the maximum size instead of allocating.

I think the same is true of most of the other allocations,
for what I can tell the use malloc just to allocate at most 32 bytes
or something like that.
Of course since those depend on the number of channels, mpeg4audio.h
should contain a definition of the maximum channels count and the
code should have an assert that checks it when reading the audio
configuration.



More information about the ffmpeg-cvslog mailing list