mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-04 06:29: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:
parent
df1d9a08fe
commit
ebc1092c4c
@ -984,8 +984,10 @@ bool SpecCache::CalculateOneSpectrum
|
|||||||
freqCorrection = multiplier * quotIm;
|
freqCorrection = multiplier * quotIm;
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t bin = (size_t)(ii + freqCorrection + 0.5f);
|
const int bin = (int)((int)ii + freqCorrection + 0.5f);
|
||||||
if (bin >= 0 && bin < hFFT->Points) {
|
// Must check if correction takes bin out of bounds, above or below!
|
||||||
|
// bin is signed!
|
||||||
|
if (bin >= 0 && bin < (int)hFFT->Points) {
|
||||||
double timeCorrection;
|
double timeCorrection;
|
||||||
{
|
{
|
||||||
const float
|
const float
|
||||||
|
Loading…
x
Reference in New Issue
Block a user