diff options
author | David Henningsson <david.henningsson@canonical.com> | 2013-06-10 16:42:47 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2013-06-14 14:09:55 +0200 |
commit | c91785e002b96afad344a8ab182e8d33e355b7f7 (patch) | |
tree | bd60d52aa38843663a723a6724981da42e760b69 | |
parent | d20e24e5d1614354e9c8195ed0b11fe089c489e4 (diff) |
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>
-rw-r--r-- | src/pcm/pcm_hw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 196393d0..9ff83a92 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -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; |