aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/decoder/FaadDecoderPlugin.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/decoder/FaadDecoderPlugin.cxx b/src/decoder/FaadDecoderPlugin.cxx
index 60d95d626..aa5c6835f 100644
--- a/src/decoder/FaadDecoderPlugin.cxx
+++ b/src/decoder/FaadDecoderPlugin.cxx
@@ -186,9 +186,13 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
return -1;
}
- if (is.IsSeekable() && length >= 2 &&
+ if (length >= 2 &&
data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) {
/* obtain the duration from the ADTS header */
+
+ if (!is.IsSeekable())
+ return -1;
+
float song_length = adts_song_duration(buffer);
is.LockSeek(tagsize, SEEK_SET, IgnoreError());