Skip to content

Commit 34a8d7c

Browse files
abonislawskilgirdwood
authored andcommitted
up_down_mixer: reject unsupported channel configurations
init_mix() left mix_routine NULL for combos unhandled by select_mix_out_*() but accepted by set_downmix_coefficients() add NULL-check before calling set_downmix_coefficients() Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent bed995f commit 34a8d7c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/audio/up_down_mixer/up_down_mixer.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ static int init_mix(struct processing_module *mod,
307307
return -EINVAL;
308308
}
309309

310+
/* select_mix_out_*() return NULL for unsupported in/out combos */
311+
if (!cd->mix_routine) {
312+
comp_err(dev, "unsupported channel configuration (in=%d out=%d)",
313+
format->ch_cfg, out_channel_config);
314+
return -EINVAL;
315+
}
316+
310317
/* Update audio format. */
311318
cd->out_fmt[0].valid_bit_depth = IPC4_DEPTH_24BIT;
312319
cd->out_fmt[0].depth = IPC4_DEPTH_32BIT;

0 commit comments

Comments
 (0)