summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r--libavformat/id3v2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index f7fa3ef856..05346350ad 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -1072,7 +1072,9 @@ static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
break;
}
- ret = avio_read(pb, buf, ID3v2_HEADER_SIZE);
+ ret = ffio_ensure_seekback(pb, ID3v2_HEADER_SIZE);
+ if (ret >= 0)
+ ret = avio_read(pb, buf, ID3v2_HEADER_SIZE);
if (ret != ID3v2_HEADER_SIZE) {
avio_seek(pb, off, SEEK_SET);
break;