]> git.alsa-project.org Git - alsa-lib.git/commit
conf: fix snd_func_imul accumulator initialization HEAD master
authorBojan Janjatovic <bojan.janjatovic@mamut-studio.com>
Thu, 7 May 2026 16:46:57 +0000 (18:46 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 5 Jul 2026 16:29:22 +0000 (18:29 +0200)
commit4011688eca48909dd2b8385be55fad3314f1546a
treea862d6cc29201ab0b558e24ddbe3b260c22c4053
parent1e27d63ef6d1dcf7d1f1a1e1eca3ea779e7de377
conf: fix snd_func_imul accumulator initialization

snd_func_iops() initialized result to 0 for both iadd and imul. For
imul this made every multiplication step multiply by 0, so
snd_func_imul() returned 0 for every input since it was added in
aa7a0dd7 (2006-10-11). The doxygen example for imul therefore did not
match observed behavior.

Initialize the accumulator to 1 for imul and keep the empty integers
list result as 0. Add table-driven config tests covering iadd and imul
single, multi, zero, negative, empty, and out-of-order integer lists.

Fixes: https://github.com/alsa-project/alsa-lib/issues/456
Closes: https://github.com/alsa-project/alsa-lib/pull/511
Signed-off-by: Bojan Janjatovic <bojan.janjatovic@mamut-studio.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/confmisc.c
test/lsb/config.c