Fix overflow while capping to signed 16bit

This commit is contained in:
Samuel Thibault
2022-04-08 01:59:31 +02:00
parent c91aa78363
commit 90c035c406
+1 -1
View File
@@ -972,7 +972,7 @@ static int PlayWave(int length, bool resume, unsigned char *data, int scale, int
value += ((echo_buf[echo_tail++] * echo_amp) >> 8);
if (value > 32767)
value = 32768;
value = 32767;
else if (value < -32768)
value = -32768;