# HG changeset patch # User Chris Cannam # Date 1236335010 0 # Node ID fe134ec37a2a63bb572278d58746c87dcebf913f # Parent 1c6439ef99d67c9c20f45cf1f4a3c2ceacb5d153 * fix unsigned overflow causing spectrogram to "disappear" in some resolution and scroll combinations diff -r 1c6439ef99d6 -r fe134ec37a2a layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Tue Mar 03 21:48:03 2009 +0000 +++ b/layer/SpectrogramLayer.cpp Fri Mar 06 10:23:30 2009 +0000 @@ -2173,7 +2173,7 @@ // std::cerr << "(giving actual minFreq " << minFreq << " and display minFreq " << displayMinFreq << ")" << std::endl; - size_t increment = getWindowIncrement(); + int increment = getWindowIncrement(); bool logarithmic = (m_frequencyScale == LogFrequencyScale); /* @@ -2663,6 +2663,10 @@ for (int sx = sx0; sx < sx1; ++sx) { +#ifdef DEBUG_SPECTROGRAM_REPAINT +// std::cerr << "sx = " << sx << std::endl; +#endif + if (sx < 0 || sx >= int(sourceModel->getWidth())) continue; if (!m_synchronous) {