mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: route plugin: allocate temporary array on stack only one time
Fixes: https://github.com/alsa-project/alsa-lib/pull/363 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
55a758a964
commit
a69ac97e4d
1 changed files with 5 additions and 1 deletions
|
|
@ -1151,6 +1151,11 @@ static int _snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_ent
|
|||
snd_config_iterator_t i, inext;
|
||||
unsigned int k;
|
||||
int err;
|
||||
|
||||
long *scha = alloca(tt_ssize * sizeof(long));
|
||||
if (scha == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
for (k = 0; k < tt_csize * tt_ssize; ++k)
|
||||
ttable[k] = 0.0;
|
||||
snd_config_for_each(i, inext, tt) {
|
||||
|
|
@ -1172,7 +1177,6 @@ static int _snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_ent
|
|||
snd_config_t *jnode = snd_config_iterator_entry(j);
|
||||
double value;
|
||||
int ss;
|
||||
long *scha = alloca(tt_ssize * sizeof(long));
|
||||
const char *id;
|
||||
if (snd_config_get_id(jnode, &id) < 0)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue