]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: sofvol plugin: fix signed overflow
authorq66 <q66@chimera-linux.org>
Thu, 7 Sep 2023 21:13:01 +0000 (23:13 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 24 Jan 2024 17:15:24 +0000 (18:15 +0100)
This fixes functionality on specific setups with UBSan.

Closes: https://github.com/alsa-project/alsa-lib/pull/351
Signed-off-by: q66 <q66@chimera-linux.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_softvol.c

index 75f2aa0a5f44c46dd88c9b1a66f7efe42e279a53..38c6367944feee5c6216e66dd328987da31bf0da 100644 (file)
@@ -113,7 +113,7 @@ static inline int MULTI_DIV_32x16(int a, unsigned short b)
        y.i = 0;
 #if __BYTE_ORDER == __LITTLE_ENDIAN
        x.i = (unsigned short)v.s[0];
-       x.i *= b;
+       x.i *= (unsigned int)b;
        y.s[0] = x.s[1];
        y.i += (int)v.s[1] * b;
 #else