ctl: fix returning zero for dimension level 4

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>
This commit is contained in:
Takashi Sakamoto 2016-06-27 22:02:57 +09:00 committed by Takashi Iwai
parent 5eb8ae1bb0
commit 7bc886584f

View 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];
}