From: Jaroslav Kysela Date: Tue, 19 Dec 2023 17:37:56 +0000 (+0100) Subject: control: remap - fix the endless loop in remap_numid_child_new() X-Git-Tag: v1.2.11~18 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=60d6fad711dc1083ce4021173f02a33ffe5030df;p=alsa-lib.git control: remap - fix the endless loop in remap_numid_child_new() Avoid the new numid search for the maped only controls. Link: https://lore.kernel.org/alsa-devel/20231219164539.GB14858@ediswmail.ad.cirrus.com/ Reported-by: Charles Keepax Signed-off-by: Jaroslav Kysela --- diff --git a/src/control/control_remap.c b/src/control/control_remap.c index 6fcb01f1..81cf38e3 100644 --- a/src/control/control_remap.c +++ b/src/control/control_remap.c @@ -148,7 +148,7 @@ static snd_ctl_numid_t *remap_numid_child_new(snd_ctl_remap_t *priv, unsigned in if (numid_child == 0) return NULL; - if (remap_find_numid_app(priv, numid_child)) { + if (priv->numid_remap_active && remap_find_numid_app(priv, numid_child)) { while (remap_find_numid_app(priv, priv->numid_app_last)) priv->numid_app_last++; numid_app = priv->numid_app_last; @@ -222,6 +222,7 @@ static snd_ctl_map_t *remap_find_map_numid(snd_ctl_remap_t *priv, unsigned int n } return NULL; } + static snd_ctl_map_t *remap_find_map_id(snd_ctl_remap_t *priv, snd_ctl_elem_id_t *id) { size_t count;