mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Fix overflow while capping to signed 16bit
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user