[MPlayer-dev-eng] [PATCH] Metadata retrieval from FLAc audio files.

Rich Felker dalias at aerifal.cx
Sun Mar 12 20:48:41 CET 2006


On Sun, Mar 12, 2006 at 07:38:46PM +0100, Jindrich Makovicka wrote:
> Benjamin Zores wrote:
> > +    blk_len = (preamble[1] << 16) | (preamble[2] << 8) | (preamble[3] << 0);
> 
> [...]
> 
> > +    case FLAC_VORBIS_COMMENT:
> > +    {
> > +      /* For a description of the format please have a look at */
> > +      /* http://www.xiph.org/vorbis/doc/v-comment.html */
> > +
> > +      uint32_t length, comment_list_len;
> > +      char comments[blk_len];
> 
> This is a c99-ism. Better use either malloc() or constant size & sanity
> check on blk_len.

No, allocation on the stack is good. gcc has supported it ever since
ages ago (gcc 2.7 iirc -- way before it was part of c99), as does
every known compiler that could possibly hope to compile MPlayer.

Rich




More information about the MPlayer-dev-eng mailing list