]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: multi: guard chmap handlers against unmapped channels
authorJaroslav Kysela <perex@perex.cz>
Mon, 30 Nov 2026 13:34:52 +0000 (14:34 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 30 Nov 2026 13:35:45 +0000 (14:35 +0100)
commit36c34b261b80be2d97bc885fe8ad3894abd22337
treeb30080a66e1bc8e3dd06b00d31b12fc46984aac1
parentedffc5f7d5ac4a58896014ab430491ff2b080849
pcm: multi: guard chmap handlers against unmapped channels

snd_pcm_multi_query_chmaps(), snd_pcm_multi_get_chmap() and
snd_pcm_multi_set_chmap() index multi->slaves[] / slave_maps[] with
bind->slave_idx without checking for the slave_idx < 0 sentinel used for
unmapped channels in sparse binding maps. For such channels this reads or
writes array index -1 (out of bounds).

Skip unmapped channels: report SND_CHMAP_UNKNOWN for the query/get paths
and leave them untouched on set. This matches the existing slave_idx < 0
handling elsewhere in the plugin (channel info, mmap commit, dump).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_multi.c