diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c index 8ea9616ec7..8fe7e1bb0e 100644 --- a/libavformat/iamf_parse.c +++ b/libavformat/iamf_parse.c @@ -398,7 +398,7 @@ 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) + if (i && layer->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++) {