aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-17 00:56:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-21 15:35:08 +0200
commit9b9e02f2ff6575e934e8e991a471b3086d1c0d53 (patch)
tree5cf61f3194fb9616d18bb508f9df343a19d86f93
parentbcab9789ef750670277956e79736bca442aec2ff (diff)
downloadffmpeg-9b9e02f2ff6575e934e8e991a471b3086d1c0d53.tar.gz
avformat/iamf_parse: Check for negative sample sizes
Fixes: index -2 out of bounds for type 'const enum AVCodecID [3]' Fixes: 69866/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4971166119821312 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/iamf_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index dd394c5564..cdfd5f75fe 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -152,7 +152,7 @@ static int ipcm_decoder_config(IAMFCodecConfig *codec_config,
};
int sample_format = avio_r8(pb); // 0 = BE, 1 = LE
int sample_size = (avio_r8(pb) / 8 - 2); // 16, 24, 32
- if (sample_format > 1 || sample_size > 2 || codec_config->audio_roll_distance)
+ if (sample_format > 1 || sample_size > 2U || codec_config->audio_roll_distance)
return AVERROR_INVALIDDATA;
codec_config->codec_id = sample_fmt[sample_format][sample_size];