diff options
author | Max Kellermann <max@duempel.org> | 2009-02-17 19:27:36 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-17 19:27:36 +0100 |
commit | 8edd4079186c951c3b3b6670a289b53ffcec963d (patch) | |
tree | 1f7f6f86cd7517637f984e7811cbc74a5beb3cf5 /src | |
parent | d75ce5c4a0add0343619d5a4e1298ffc4095b2f3 (diff) | |
download | mpd-8edd4079186c951c3b3b6670a289b53ffcec963d.tar.gz mpd-8edd4079186c951c3b3b6670a289b53ffcec963d.tar.xz mpd-8edd4079186c951c3b3b6670a289b53ffcec963d.zip |
faad: added length check before comparing "ADIF"
It's not valid to use the buffer's data without ensuring that the
buffer contains enough data.
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder/faad_plugin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/decoder/faad_plugin.c b/src/decoder/faad_plugin.c index ec93b9f47..77d12066c 100644 --- a/src/decoder/faad_plugin.c +++ b/src/decoder/faad_plugin.c @@ -217,7 +217,7 @@ faad_song_duration(struct faad_buffer *b, float *length) b->consumed = 0; faad_buffer_fill(b); - } else if (memcmp(b->data, "ADIF", 4) == 0) { + } else if (b->length >= 5 && memcmp(b->data, "ADIF", 4) == 0) { unsigned bit_rate; size_t skip_size = (b->data[4] & 0x80) ? 9 : 0; |