Enforce no-null-args to FFTs; avoid corresponding potential crash in formant preservation code

This commit is contained in:
Chris Cannam
2012-10-28 10:23:42 +00:00
parent 39a311b383
commit 82d1f570da
3 changed files with 63 additions and 3 deletions

View File

@@ -930,7 +930,8 @@ RubberBandStretcher::Impl::formantShiftChunk(size_t channel)
v_scale(dblbuf, factor, cutoff);
cd.fft->forward(dblbuf, envelope, 0);
double *spare = (double *)alloca((hs + 1) * sizeof(double));
cd.fft->forward(dblbuf, envelope, spare);
v_exp(envelope, hs + 1);
v_divide(mag, envelope, hs + 1);