Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14387
Modified Files: WaveClip.cpp Log Message: If GetSpectrogram needs to zero-pad BOTH the start and the end of the buffer, there will be a buffer overrun. This change makes sure the zero padding only goes out to the end of the defined buffer. Index: WaveClip.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/WaveClip.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- WaveClip.cpp 20 Apr 2009 17:27:22 -0000 1.49 +++ WaveClip.cpp 3 Jul 2009 05:25:00 -0000 1.50 @@ -769,14 +769,15 @@ } #ifdef EXPERIMENTAL_FFT_SKIP_POINTS if (start + len*fftSkipPoints1 > mSequence->GetNumSamples()) { - len = (mSequence->GetNumSamples() - start)/fftSkipPoints1; - for (i = len*fftSkipPoints1; i < (sampleCount)windowSize; i++) + int newlen = (mSequence->GetNumSamples() - start)/fftSkipPoints1; + for (i = newlen*fftSkipPoints1; i < (sampleCount)len*fftSkipPoints1; i++) #else //!EXPERIMENTAL_FFT_SKIP_POINTS if (start + len > mSequence->GetNumSamples()) { - len = mSequence->GetNumSamples() - start; - for (i = len; i < (sampleCount)windowSize; i++) + int newlen = mSequence->GetNumSamples() - start; + for (i = newlen; i < (sampleCount)len; i++) #endif //EXPERIMENTAL_FFT_SKIP_POINTS adj[i] = 0; + len = newlen; } if (len > 0) ------------------------------------------------------------------------------ _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs