aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-11-18 19:04:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-06-04 20:18:12 +0200
commit76d48fbd867e206a26d9c312bf428378394b39ec (patch)
treedcccbb14e543153379c7b1df7d7645a1dbb64fc5
parente4b0610c6a787b9a9c5097758791ea0ef36a0a46 (diff)
downloadffmpeg-76d48fbd867e206a26d9c312bf428378394b39ec.tar.gz
avformat/id3v2: Check taglen in read_uslt()
Fixes: Timeout (read mostly the same data repeatly) Fixes: 52457/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-6610706313379840 Fixes: 53098/clusterfuzz-testcase-minimized-ffmpeg_dem_SOL_fuzzer-6481382981632000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a798af91d7d1fc31cfc1ae09cc6ab3907304f44f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/id3v2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index a1ef29ab01..a38cb5a6db 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -375,10 +375,10 @@ static void read_uslt(AVFormatContext *s, AVIOContext *pb, int taglen,
lang[3] = '\0';
taglen -= 3;
- if (decode_str(s, pb, encoding, &descriptor, &taglen) < 0)
+ if (decode_str(s, pb, encoding, &descriptor, &taglen) < 0 || taglen < 0)
goto error;
- if (decode_str(s, pb, encoding, &text, &taglen) < 0)
+ if (decode_str(s, pb, encoding, &text, &taglen) < 0 || taglen < 0)
goto error;
// FFmpeg does not support hierarchical metadata, so concatenate the keys.