Browse Source

Fix overflow while capping to signed 16bit

master
Samuel Thibault 3 years ago
parent
commit
90c035c406
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/libespeak-ng/wavegen.c

+ 1
- 1
src/libespeak-ng/wavegen.c 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;


Loading…
Cancel
Save