Changeset e7e11bf for src/pitch


Ignore:
Timestamp:
Jul 11, 2012, 12:28:39 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
c1ca5b6
Parents:
9d6001cb
Message:

src/pitch/pitchschmitt.c: avoid out of bound reads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitchschmitt.c

    r9d6001cb re7e11bf  
    8585      t2 = -(sint_t) (A2 * trigfact + 0.5);
    8686      startpoint = 0;
    87       for (j = 1; schmittBuffer[j] <= t1 && j < blockSize; j++);
    88       for (; !(schmittBuffer[j] >= t2 &&
    89               schmittBuffer[j + 1] < t2) && j < blockSize; j++);
     87      for (j = 1; j < blockSize && schmittBuffer[j] <= t1; j++);
     88      for (     ; j < blockSize - 1 && !(schmittBuffer[j] >= t2 &&
     89             schmittBuffer[j + 1] < t2); j++);
    9090      startpoint = j;
    9191      schmittTriggered = 0;
Note: See TracChangeset for help on using the changeset viewer.