From ffd3cd2a46d7da87a6e0ea3fe3d4270d24d704df Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Fri, 12 Jun 2026 08:09:14 +0200 Subject: [PATCH] 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 --- src/audio/up_down_mixer/up_down_mixer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/audio/up_down_mixer/up_down_mixer.c b/src/audio/up_down_mixer/up_down_mixer.c index a5843026710a..4a9a644434e7 100644 --- a/src/audio/up_down_mixer/up_down_mixer.c +++ b/src/audio/up_down_mixer/up_down_mixer.c @@ -307,6 +307,13 @@ static int init_mix(struct processing_module *mod, return -EINVAL; } + /* select_mix_out_*() return NULL for unsupported in/out combos */ + if (!cd->mix_routine) { + comp_err(dev, "unsupported channel configuration (in=%d out=%d)", + format->ch_cfg, out_channel_config); + return -EINVAL; + } + /* Update audio format. */ cd->out_fmt[0].valid_bit_depth = IPC4_DEPTH_24BIT; cd->out_fmt[0].depth = IPC4_DEPTH_32BIT;