avformat/iamf_parse: ensure each layout in an scalable channel representation has an increasing number of channels

Fixes issue #21013

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-11-25 10:26:27 -03:00
parent 3bcf2be06c
commit 554ae5ada9

View File

@@ -406,6 +406,9 @@ static int scalable_channel_layout_config(void *s, AVIOContext *pb,
.nb_channels = substream_count +
coupled_substream_count };
if (i && ch_layout.nb_channels <= audio_element->element->layers[i-1]->ch_layout.nb_channels)
return AVERROR_INVALIDDATA;
for (int j = 0; j < substream_count; j++) {
IAMFSubStream *substream = &audio_element->substreams[k++];