mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm_hw: Fix buffer overflow in chmap
We can't calculate memory storage in bytes, when we're supposed to store ints in it! Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d20e24e5d1
commit
c91785e002
1 changed files with 1 additions and 1 deletions
|
|
@ -1187,7 +1187,7 @@ static snd_pcm_chmap_t *snd_pcm_hw_get_chmap(snd_pcm_t *pcm)
|
|||
snd_pcm_state_name(FAST_PCM_STATE(hw)));
|
||||
return NULL;
|
||||
}
|
||||
map = malloc(pcm->channels + 1);
|
||||
map = malloc(pcm->channels * sizeof(map->pos[0]) + sizeof(*map));
|
||||
if (!map)
|
||||
return NULL;
|
||||
map->channels = pcm->channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue