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

value += ((echo_buf[echo_tail++] * echo_amp) >> 8); value += ((echo_buf[echo_tail++] * echo_amp) >> 8);


if (value > 32767) if (value > 32767)
value = 32768;
value = 32767;
else if (value < -32768) else if (value < -32768)
value = -32768; value = -32768;



Loading…
Cancel
Save