1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

id3v2: skip broken tags with invalid size

fixes issue2649.
This commit is contained in:
Anton Khirnov 2011-03-22 10:35:35 +01:00 committed by Justin Ruggles
parent 1885488757
commit c5f4c0fd5c

View File

@ -237,11 +237,11 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
tag[3] = 0;
tlen = avio_rb24(s->pb);
}
len -= taghdrlen + tlen;
if (len < 0)
if (tlen < 0 || tlen > len - taghdrlen) {
av_log(s, AV_LOG_WARNING, "Invalid size in frame %s, skipping the rest of tag.\n", tag);
break;
}
len -= taghdrlen + tlen;
next = avio_tell(s->pb) + tlen;
if (tflags & ID3v2_FLAG_DATALEN) {