]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ctl: fix returning zero for dimension level 4
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 27 Jun 2016 13:02:57 +0000 (22:02 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Jun 2016 13:34:06 +0000 (15:34 +0200)
In ALSA kernel/userspace interfaces, 'struct snd_ctl_elem_info' has a
'dimension' parameter. This parameter consists of an array with four
elements. Each element represents the number of members in corresponding
dimension level to construct matrix.

In current implementation, a get function, 'snd_ctl_elem_info_get_dimension()'
is hardcoded to return zero to level 4, against actual value. This commit fixes
the bug.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/control/control.c

index d515cffda55d793ad0987ba2b0cafb25fa61879e..0cb0105744f6d4468c8a44c991f16a6781cfd026 100644 (file)
@@ -2483,7 +2483,7 @@ int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int
 #endif
 {
        assert(obj);
-       if (idx >= 3)
+       if (idx > 3)
                return 0;
        return obj->dimen.d[idx];
 }