Commit 54b6f8a4 authored by Max Kellermann's avatar Max Kellermann

decoder/faad: test "seekable" after ADTS frame check

Don't bother to check for ADIF just because the stream is not seekable.
parent 18787ebe
...@@ -186,9 +186,13 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is) ...@@ -186,9 +186,13 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
return -1; return -1;
} }
if (is.IsSeekable() && length >= 2 && if (length >= 2 &&
data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) { data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) {
/* obtain the duration from the ADTS header */ /* obtain the duration from the ADTS header */
if (!is.IsSeekable())
return -1;
float song_length = adts_song_duration(buffer); float song_length = adts_song_duration(buffer);
is.LockSeek(tagsize, SEEK_SET, IgnoreError()); is.LockSeek(tagsize, SEEK_SET, IgnoreError());
......
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