diff options
Diffstat (limited to 'src/decoder/faad_plugin.c')
-rw-r--r-- | src/decoder/faad_plugin.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/decoder/faad_plugin.c b/src/decoder/faad_plugin.c index d0537dd5b..7b2806a4c 100644 --- a/src/decoder/faad_plugin.c +++ b/src/decoder/faad_plugin.c @@ -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; |