Commit 835b0c44 authored by Max Kellermann's avatar Max Kellermann

decoder/faad: use adts_check_frame() in faad_song_duration()

Eliminate more duplicate code.
parent 54b6f8a4
...@@ -186,8 +186,7 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is) ...@@ -186,8 +186,7 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
return -1; return -1;
} }
if (length >= 2 && if (length >= 8 && adts_check_frame(data) > 0) {
data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) {
/* obtain the duration from the ADTS header */ /* obtain the duration from the ADTS header */
if (!is.IsSeekable()) if (!is.IsSeekable())
......
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