[FFmpeg-cvslog] avformat/iamf_parse: Check sound_system

Michael Niedermayer git at videolan.org
Thu Apr 4 22:40:31 EEST 2024


ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Thu Apr  4 00:20:34 2024 +0200| [97751fda3eb4adef67b93a7033e81299133ddd7b] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 4593cf7ab3f0ff2884880b625f1873f0eaf7a439)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=97751fda3eb4adef67b93a7033e81299133ddd7b
---

 libavformat/iamf_parse.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index cb49cf0a57..210cadd85a 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -933,6 +933,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);
             }
 



More information about the ffmpeg-cvslog mailing list