mux: add channels check in mux_prepare_active_look_up()

This commit adds channel parameter checking in
mux_prepare_active_look_up() function. Look up
table should not include elements referring to
channels higher than those actually set in
source/sink buffers.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit is contained in:
Bartosz Kokoszko 2020-11-04 11:48:53 +01:00 committed by Liam Girdwood
parent 473d8894f0
commit acc022b4c4
1 changed files with 6 additions and 0 deletions

View File

@ -336,6 +336,12 @@ static void mux_prepare_active_look_up(struct comp_dev *dev,
if (!source)
continue;
if ((cd->lookup[0].copy_elem[elem].in_ch >
(source->channels - 1)) ||
(cd->lookup[0].copy_elem[elem].out_ch >
(sink->channels - 1)))
continue;
cd->active_lookup.copy_elem[active_elem] =
cd->lookup[0].copy_elem[elem];
active_elem++;