From d03f29eb66a273f72c30314a906a44f8563c749e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 Jul 2021 11:12:37 +0200 Subject: [PATCH] pulse-server: fix channel_map check We store the spa channel ids in the channel_map so convert them to pulseaudio ids before comparing them to the max pulseaudio id. --- src/modules/module-protocol-pulse/format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/format.c b/src/modules/module-protocol-pulse/format.c index 777749185..bb8b6535f 100644 --- a/src/modules/module-protocol-pulse/format.c +++ b/src/modules/module-protocol-pulse/format.c @@ -371,10 +371,11 @@ void channel_map_parse(const char *str, struct channel_map *map) bool channel_map_valid(const struct channel_map *map) { uint8_t i; + uint32_t aux = 0; if (map->channels == 0 || map->channels > CHANNELS_MAX) return false; for (i = 0; i < map->channels; i++) - if (map->map[i] >= CHANNEL_POSITION_MAX) + if (channel_id2pa(map->map[i], &aux) >= CHANNEL_POSITION_MAX) return false; return true; }