aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/faad_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-03 16:17:02 +0200
committerMax Kellermann <max@duempel.org>2009-10-03 16:17:02 +0200
commit7013f9fc3105a4e928cbd87bb177325e9b26bbc6 (patch)
tree353ca385fca5ab75aedabb2fd8948b2316e48afe /src/decoder/faad_plugin.c
parent31cabc751d2dc6721706d878a0694afc83ef6a0c (diff)
parent325e380b8e44fd07a3e477e8fcfed9e6e1c80e7f (diff)
downloadmpd-7013f9fc3105a4e928cbd87bb177325e9b26bbc6.tar.gz
mpd-7013f9fc3105a4e928cbd87bb177325e9b26bbc6.tar.xz
mpd-7013f9fc3105a4e928cbd87bb177325e9b26bbc6.zip
Merged release 0.15.4 from branch 'v0.15.x'
Conflicts: NEWS configure.ac
Diffstat (limited to 'src/decoder/faad_plugin.c')
-rw-r--r--src/decoder/faad_plugin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/decoder/faad_plugin.c b/src/decoder/faad_plugin.c
index 1b8b2b784..516f741c7 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;