Browse Source

Fix weird uninitialized memory error from Valgrind.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
540900d909
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/dsp/minblep.cpp

+ 2
- 0
src/dsp/minblep.cpp View File

@@ -21,6 +21,8 @@ void minBlepImpulse(int z, int o, float* output) {

// Real cepstrum
float* fx = new float[2 * n];
// Valgrind complains that the array is uninitialized for some reason, unless we clear it.
std::memset(fx, 0, sizeof(float) * 2 * n);
RealFFT rfft(n);
rfft.rfft(x, fx);
// fx = log(abs(fx))


Loading…
Cancel
Save