diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index bec3300ad6..63df4c21c4 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -1005,6 +1005,9 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata, av_log(s, AV_LOG_DEBUG, "Compresssed frame %s tlen=%d dlen=%ld\n", tag, tlen, dlen); + if (tlen <= 0) + goto seek; + av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen); if (!uncompressed_buffer) { av_log(s, AV_LOG_ERROR, "Failed to alloc %ld bytes\n", dlen);