ctl: add dimension validator
ctl: add dimension validator

Linux 4.7 or former have no validator of dimension information. This can
causes an issue related to user-defined element set. For example, When
calculated total members in multi-dimensional matrix is larger than actual
capacity of snd_ctl_elem_value_t, processes to handle the element can
cause buffer-over-run.

For backward portability of this userspace library, this commit adds a
validator of dimension information. When userspace applications give
invalid dimension information to APIs to add element set, they receive
-EINVAL.

Signed-off-by: Takashi Sakamoto <d5ec7d0cd8074757a1f5eb708bc105c3065a65ea@sakamocchi.jp>
Signed-off-by: Takashi Iwai <4596b3305151c7ee743192a95d394341e3d3b644@suse.de>

takaswie/alsa-lib,zedongchen/alsa-lib,alsa-project/alsa-lib,tiwai/alsa-lib,zedongchen/alsa-lib,zedongchen/alsa-lib,alsa-project/alsa-lib,takaswie/alsa-lib,alsa-project/alsa-lib,tiwai/alsa-lib,takaswie/alsa-lib,takaswie/alsa-lib,tiwai/alsa-lib,alsa-project/alsa-lib,zedongchen/alsa-lib,takaswie/alsa-lib,tiwai/alsa-lib,zedongchen/alsa-lib