Commit b0f9a145 authored by Max Kellermann's avatar Max Kellermann

decoder/faad: skip assertion failure on large ID3 tags

When the ID3 tag in an AAC file is larger than the current buffer, the function decoder_buffer_consume() aborts. By using the new function decoder_buffer_skip() instead, we can safely skip the ID3 tag.
parent efb29007
ver 0.15.4 (2009/??/??)
* decoders:
- vorbis: revert "faster tag scanning with ov_test_callback()"
- faad: skip assertion failure on large ID3 tags
* output:
- osx: fix the OS X 10.6 build
......
......@@ -162,6 +162,7 @@ faad_song_duration(struct decoder_buffer *buffer, struct input_stream *is)
size_t tagsize;
const unsigned char *data;
size_t length;
bool success;
fileread = is->size >= 0 ? is->size : 0;
......@@ -179,8 +180,11 @@ faad_song_duration(struct decoder_buffer *buffer, struct input_stream *is)
tagsize += 10;
decoder_buffer_consume(buffer, tagsize);
decoder_buffer_fill(buffer);
success = decoder_buffer_skip(buffer, tagsize) &&
decoder_buffer_fill(buffer);
if (!success)
return -1;
data = decoder_buffer_read(buffer, &length);
if (data == NULL)
return -1;
......
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