summaryrefslogtreecommitdiff
path: root/libavformat/iamf_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/iamf_parse.c')
-rw-r--r--libavformat/iamf_parse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index 3867adb117..f8074c2de1 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -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);
}