aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/FaadDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-11 23:58:51 +0200
committerMax Kellermann <max@duempel.org>2014-07-12 00:17:51 +0200
commit54b6f8a4ae90ef1603b817902c12650eeb8328c6 (patch)
treeb373f0aa735d4f0c1c587972b812a36119e35684 /src/decoder/FaadDecoderPlugin.cxx
parent18787ebe8f4159d68dc9bb283a6a6ddcbb2f15e7 (diff)
downloadmpd-54b6f8a4ae90ef1603b817902c12650eeb8328c6.tar.gz
mpd-54b6f8a4ae90ef1603b817902c12650eeb8328c6.tar.xz
mpd-54b6f8a4ae90ef1603b817902c12650eeb8328c6.zip
decoder/faad: test "seekable" after ADTS frame check
Don't bother to check for ADIF just because the stream is not seekable.
Diffstat (limited to '')
-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());