# HG changeset patch # User Chris Cannam # Date 1586440745 -3600 # Node ID 915d316a56096206443ac2a4dc3dad7cc1fd70e3 # Parent 403e961ec6ab45548a2a31ad24e2caf3ccfe2107 Fix out of range access to magnitudes diff -r 403e961ec6ab -r 915d316a5609 data/model/FFTModel.cpp --- a/data/model/FFTModel.cpp Thu Apr 09 11:23:17 2020 +0100 +++ b/data/model/FFTModel.cpp Thu Apr 09 14:59:05 2020 +0100 @@ -223,7 +223,9 @@ bool FFTModel::getMagnitudesAt(int x, float *values, int minbin, int count) const { - if (count == 0) count = getHeight(); + if (count == 0) { + count = getHeight() - minbin; + } auto col = getFFTColumn(x); for (int i = 0; i < count; ++i) { values[i] = abs(col[minbin + i]);