Commit 8edd4079 authored by Max Kellermann's avatar Max Kellermann

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.
parent d75ce5c4
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment