]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/id3v2.c
Merge commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f'
[ffmpeg] / libavformat / id3v2.c
index f805f5bac22200160af9a3e85a6ed1ed7d48b11e..2cab5ac3045e4e53ea50bbdbc82177592065fca5 100644 (file)
@@ -788,10 +788,12 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra
         /* save the current offset in case there's nothing to read/skip */
         off = avio_tell(s->pb);
         ret = avio_read(s->pb, buf, ID3v2_HEADER_SIZE);
-        if (ret != ID3v2_HEADER_SIZE)
+        if (ret != ID3v2_HEADER_SIZE) {
+            avio_seek(s->pb, off, SEEK_SET);
             break;
-            found_header = ff_id3v2_match(buf, magic);
-            if (found_header) {
+        }
+        found_header = ff_id3v2_match(buf, magic);
+        if (found_header) {
             /* parse ID3v2 header */
             len = ((buf[6] & 0x7f) << 21) |
                   ((buf[7] & 0x7f) << 14) |