From 9dccd7919172cbe6aa54f28c864e4bb6bbc75e4a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Oct 2021 10:50:09 +0200 Subject: [PATCH] acp: ensure we don't make invalid channels There are only 32 AUX channels in pulseaudio so wrap around when we have more. --- spa/plugins/alsa/acp/channelmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/alsa/acp/channelmap.h b/spa/plugins/alsa/acp/channelmap.h index ee20801e3..9dc9b8c3d 100644 --- a/spa/plugins/alsa/acp/channelmap.h +++ b/spa/plugins/alsa/acp/channelmap.h @@ -194,7 +194,7 @@ static inline pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, if (pa_channel_map_init_auto(m, c, def) == NULL) continue; for (i = 0; c < channels; c++, i++) - m->map[c] = PA_CHANNEL_POSITION_AUX0 + i; + m->map[c] = PA_CHANNEL_POSITION_AUX0 + (i & 31); m->channels = (uint8_t) channels; return m; }