aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-28 23:43:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-01-19 00:05:50 +0100
commitc48110a4a4b3ba87cb3ffe66753bff13c618a04d (patch)
treefbdba57bb188f9cbaf64c8716c6b6c6d9aba93c7
parent7d7ae689729ab331d67c2e17442715c75aca6e4a (diff)
downloadffmpeg-c48110a4a4b3ba87cb3ffe66753bff13c618a04d.tar.gz
avformat/id3v2: Check against max compression ratio before allocation
Fixes: Timeout (>10sec -> 12ms) Fixes: 27612/clusterfuzz-testcase-minimized-ffmpeg_dem_PCM_S24BE_fuzzer-6605893000757248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/id3v2.c2
1 files changed, 2 insertions, 0 deletions
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) {