Browse Source

Add n_points guards in the LoadEnvelope2 loop.

Clang static analysis reports these as 'Result of operation is
garbage or undefined' errors.
master
Reece H. Dunn 7 years ago
parent
commit
57108e1ed7
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/libespeak-ng/compiledata.c

+ 3
- 3
src/libespeak-ng/compiledata.c View File

@@ -1408,10 +1408,10 @@ static int LoadEnvelope2(FILE *f, const char *fname)

ix = -1;
ix2 = 0;
for (x = 0; x < ENV_LEN; x++) {
if (x > env_x[ix+4])
if (n_points > 0) for (x = 0; x < ENV_LEN; x++) {
if (n_points > 3 && x > env_x[ix+4])
ix++;
if (x >= env_x[ix2+1])
if (n_points > 2 && x >= env_x[ix2+1])
ix2++;

if (env_lin[ix2] > 0) {

Loading…
Cancel
Save