aac: check the buffer length in the ADIF parser

Check whether enough data has been read yet.
This commit is contained in:
Max Kellermann 2008-11-12 08:16:54 +01:00
parent b30ec73099
commit e19b53f814

View File

@ -220,6 +220,12 @@ static void aac_parse_header(AacBuffer * b, float *length)
unsigned bitRate;
size_t skipSize = (b->buffer[4] & 0x80) ? 9 : 0;
if (8 + skipSize > b->bytesIntoBuffer)
/* not enough data yet; skip parsing this
header */
return;
bitRate =
((unsigned int)(b->
buffer[4 +