]> git.alsa-project.org Git - alsa-lib.git/commitdiff
namehint: correct the @args check
authorJaroslav Kysela <perex@perex.cz>
Sun, 1 Dec 2019 13:26:40 +0000 (14:26 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 1 Dec 2019 13:27:04 +0000 (14:27 +0100)
BugLink: https://github.com/alsa-project/alsa-plugins/issues/3
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/control/namehint.c

index 808df6b507336b8f6d6e618a0cfa520d62a3b4fc..4927ef973c326bef41e33b87714de87b31c1f752 100644 (file)
@@ -348,6 +348,12 @@ static int try_config(snd_config_t *config,
                goto __cleanup;
        if (snd_config_search(res, "@args", &cfg) >= 0) {
                snd_config_for_each(i, next, cfg) {
+                       /* skip the argument list */
+                       snd_config_get_id(snd_config_iterator_entry(i), &str);
+                       while (*str && *str >= '0' && *str <= '9') str++;
+                       if (*str == '\0')
+                               continue;
+                       /* the argument definition must have the default */
                        if (snd_config_search(snd_config_iterator_entry(i),
                                              "default", NULL) < 0) {
                                err = -EINVAL;