# HG changeset patch # User mru # Date 1150490493 0 # Node ID f9d739057d6cb73b49fa38258c87606627de8546 # Parent 35757cceddd0afd02bdf362ab6e417d72df134f9 The AAC frame header uses 13 bits for the frame size, so the buffer should have room for such a frame. A frame that large seems unlikely in a valid file, but leaving room for it spares us the need to check it elsewhere. Moving the buffer to the end of the struct made debugging this easier. diff -r 35757cceddd0 -r f9d739057d6c parser.c --- a/parser.c Thu Jun 15 09:20:31 2006 +0000 +++ b/parser.c Fri Jun 16 20:41:33 2006 +0000 @@ -729,12 +729,12 @@ /* also used for ADTS AAC */ typedef struct AC3ParseContext { - uint8_t inbuf[4096]; /* input buffer */ uint8_t *inbuf_ptr; int frame_size; int header_size; int (*sync)(const uint8_t *buf, int *channels, int *sample_rate, int *bit_rate, int *samples); + uint8_t inbuf[8192]; /* input buffer */ } AC3ParseContext; #define AC3_HEADER_SIZE 7