changeset 217:b3dfc3714006

* Fix a crash in spectrogram * Don't clear background of curved area of thumbwheel (this way it looks better on a dark background)
author Chris Cannam
date Mon, 22 Jan 2007 16:09:03 +0000
parents 7f8ffe65d453
children 4882563bd2b3
files data/fft/FFTDataServer.cpp
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;