avformat/iamf_parse: Check sound_system

Fixes: index 13 out of bounds for type 'const struct IAMFSoundSystemMap [13]'
Fixes: 67796/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4554553191104512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-04-04 00:20:34 +02:00
parent 28c7094b25
commit 4593cf7ab3
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 4 additions and 0 deletions

View File

@ -934,6 +934,10 @@ static int mix_presentation_obu(void *s, IAMFContext *c, AVIOContext *pb, int le
if (submix_layout->layout_type == 2) {
int sound_system;
sound_system = (byte >> 2) & 0xF;
if (sound_system >= FF_ARRAY_ELEMS(ff_iamf_sound_system_map)) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
av_channel_layout_copy(&submix_layout->sound_system, &ff_iamf_sound_system_map[sound_system].layout);
}