]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: multi: Drop the fixed slave_map[] in snd_pcm_multi_open()
authorTakashi Iwai <tiwai@suse.de>
Fri, 27 Jan 2017 11:01:51 +0000 (12:01 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 27 Jan 2017 11:05:32 +0000 (12:05 +0100)
commite1143dd9ba350eb19d13d4e298eeb55179712a1e
tree8ec150d9180971a76e27e15a8081ceaa5aaea682
parent4dfa8f08fb834f7b087f35f9ba1746cd0c989d02
pcm: multi: Drop the fixed slave_map[] in snd_pcm_multi_open()

slave_map[] in snd_pcm_multi_open() is a fixed size array and
obviously we have no overflow check, and eventually the program gets
an error when more than 64 channels are used.

Although we can modify the code to allocate the array dynamically, it
turned out that we can drop the whole slave_map[] thingy in this
function when looking at the code closely.  In the past, it was used
to identify the one-to-many mapping.  But the check was dropped, and
now it's nothing more than a sanity check.

Reported-by: Jörg Müller <joerg.mueller7744@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_multi.c