# HG changeset patch # User Chris Cannam # Date 1169482143 0 # Node ID b3dfc3714006a8311a116512e116983bfa5a4b51 # Parent 7f8ffe65d453fded97ed8ccbc6041451b77bc561 * Fix a crash in spectrogram * Don't clear background of curved area of thumbwheel (this way it looks better on a dark background) diff -r 7f8ffe65d453 -r b3dfc3714006 data/fft/FFTDataServer.cpp --- a/data/fft/FFTDataServer.cpp Mon Jan 22 13:20:54 2007 +0000 +++ b/data/fft/FFTDataServer.cpp Mon Jan 22 16:09:03 2007 +0000 @@ -834,6 +834,8 @@ { Profiler profiler("FFTDataServer::getMagnitudeAt", false); + if (x >= m_width || y >= m_height) return 0; + size_t col; FFTCache *cache = getCache(x, col); if (!cache) return 0; @@ -851,6 +853,8 @@ { Profiler profiler("FFTDataServer::getNormalizedMagnitudeAt", false); + if (x >= m_width || y >= m_height) return 0; + size_t col; FFTCache *cache = getCache(x, col); if (!cache) return 0; @@ -866,6 +870,8 @@ { Profiler profiler("FFTDataServer::getMaximumMagnitudeAt", false); + if (x >= m_width) return 0; + size_t col; FFTCache *cache = getCache(x, col); if (!cache) return 0; @@ -881,6 +887,8 @@ { Profiler profiler("FFTDataServer::getPhaseAt", false); + if (x >= m_width || y >= m_height) return 0; + size_t col; FFTCache *cache = getCache(x, col); if (!cache) return 0; @@ -928,6 +936,8 @@ { Profiler profiler("FFTDataServer::isColumnReady", false); + if (x >= m_width) return true; + if (!haveCache(x)) { if (m_lastUsedCache == -1) { if (m_suspended) { @@ -951,6 +961,20 @@ { Profiler profiler("FFTDataServer::fillColumn", false); + if (!m_fftInput) { + std::cerr << "WARNING: FFTDataServer::fillColumn(" << x << "): " + << "input has already been completed and discarded?" + << std::endl; + return; + } + + if (x >= m_width) { + std::cerr << "WARNING: FFTDataServer::fillColumn(" << x << "): " + << "x > width (" << x << " > " << m_width << ")" + << std::endl; + return; + } + size_t col; #ifdef DEBUG_FFT_SERVER_FILL std::cout << "FFTDataServer::fillColumn(" << x << ")" << std::endl;