]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/id3v2.c
aacdec: Lower the number of frames required to detect ADTS
[ffmpeg] / libavformat / id3v2.c
index 0563e6bf8517cb06309792fe406f98ce24407cf2..e5f7486e1d352f780ee5f010e0dc929579ca8802 100644 (file)
@@ -644,9 +644,10 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
                     goto seek;
                 }
                 b = buffer;
-                while (avio_tell(s->pb) < end) {
+                while (avio_tell(s->pb) < end && !s->pb->eof_reached) {
                     *b++ = avio_r8(s->pb);
-                    if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1) {
+                    if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1 &&
+                        !s->pb->eof_reached ) {
                         uint8_t val = avio_r8(s->pb);
                         *b++ = val ? val : avio_r8(s->pb);
                     }