diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 336a3964de..97f6cc8a68 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -995,6 +995,8 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata, if (tlen <= 0) goto seek; + if (dlen / 32768 > tlen) + goto seek; av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen); if (!uncompressed_buffer) {