1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

One of the compilation warning patches in f463eda36c059 made a bug...

... the variable bin may indeed be sometimes negative:  see the test that
follows.
This commit is contained in:
Paul Licameli 2018-01-06 18:22:12 -05:00
parent df1d9a08fe
commit ebc1092c4c

View File

@ -984,8 +984,10 @@ bool SpecCache::CalculateOneSpectrum
freqCorrection = multiplier * quotIm;
}
const size_t bin = (size_t)(ii + freqCorrection + 0.5f);
if (bin >= 0 && bin < hFFT->Points) {
const int bin = (int)((int)ii + freqCorrection + 0.5f);
// Must check if correction takes bin out of bounds, above or below!
// bin is signed!
if (bin >= 0 && bin < (int)hFFT->Points) {
double timeCorrection;
{
const float