# HG changeset patch # User Chris Cannam # Date 1433939481 -3600 # Node ID e4d40c185c72e262d7d5336ebaa856888bf2fe1d # Parent 7fb788f891d0ec9f852f34e414a3d2f088b21a2a Fix overflow in width calculation diff -r 7fb788f891d0 -r e4d40c185c72 data/fft/FFTDataServer.cpp --- a/data/fft/FFTDataServer.cpp Wed Jun 10 13:14:32 2015 +0100 +++ b/data/fft/FFTDataServer.cpp Wed Jun 10 13:31:21 2015 +0100 @@ -529,7 +529,7 @@ int maxCacheSize = 20 * 1024 * 1024; int columnSize = int(m_height * sizeof(fftsample) * 2 + sizeof(fftsample)); - if (m_width * columnSize < maxCacheSize * 2) m_cacheWidth = m_width; + if (m_width < ((maxCacheSize * 2) / columnSize)) m_cacheWidth = m_width; else m_cacheWidth = maxCacheSize / columnSize; #ifdef DEBUG_FFT_SERVER @@ -1411,13 +1411,13 @@ QString err; if (m_error != "") { err = m_error; - cerr << "FFTDataServer::getError: err (server " << this << ") = " << err << endl; +// cerr << "FFTDataServer::getError: err (server " << this << ") = " << err << endl; } else { MutexLocker locker(&m_fftBuffersLock, "FFTDataServer::getError"); if (m_fillThread) { err = m_fillThread->getError(); - cerr << "FFTDataServer::getError: err (server " << this << ", from thread " << m_fillThread - << ") = " << err << endl; +// cerr << "FFTDataServer::getError: err (server " << this << ", from thread " << m_fillThread +// << ") = " << err << endl; } } return err;