aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/aac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-12 08:16:54 +0100
committerMax Kellermann <max@duempel.org>2008-11-12 08:16:54 +0100
commite19b53f81495704b9286b08529017815a5d6becc (patch)
tree4dc127c24fc1d6d9d35ce7b1c7a614fbaf53cd22 /src/decoder/aac_plugin.c
parentb30ec73099bc42b0ccb9202cc7ab7269e5adb2d1 (diff)
downloadmpd-e19b53f81495704b9286b08529017815a5d6becc.tar.gz
mpd-e19b53f81495704b9286b08529017815a5d6becc.tar.xz
mpd-e19b53f81495704b9286b08529017815a5d6becc.zip
aac: check the buffer length in the ADIF parser
Check whether enough data has been read yet.
Diffstat (limited to '')
-rw-r--r--src/decoder/aac_plugin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/decoder/aac_plugin.c b/src/decoder/aac_plugin.c
index 477efb773..63003e7c2 100644
--- a/src/decoder/aac_plugin.c
+++ b/src/decoder/aac_plugin.c
@@ -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 +