From faa382e5b196f2acb5bc5b159aaf06682291328b Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 25 Nov 2025 12:42:30 -0300 Subject: [PATCH] avformat/iamf_parse: ensure the stream count in a scalable channel representation is equal to the audio element's stream count Signed-off-by: James Almer --- libavformat/iamf_parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c index 737e3f7404..597d800be0 100644 --- a/libavformat/iamf_parse.c +++ b/libavformat/iamf_parse.c @@ -480,6 +480,9 @@ static int scalable_channel_layout_config(void *s, AVIOContext *pb, av_channel_layout_copy(&layer->ch_layout, &ch_layout); } + if (k != audio_element->nb_substreams) + return AVERROR_INVALIDDATA; + return 0; }