X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fid3v2.c;h=05346350ada048b91f1eb93cfe7c926b44736c41;hb=189ff4219644532bdfa7bab28dfedaee4d6d4021;hp=f7fa3ef8561b4db438d30556930e7815b711daeb;hpb=90fe0800fb84d46994c351e0c0ff200a14d27168;p=ffmpeg diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index f7fa3ef8561..05346350ada 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;