Fix access past end of vector in getPsychedelicColor

This commit is contained in:
Jim Broadus 2020-07-12 23:07:55 -07:00 committed by John Maguire
parent 1f7607b1db
commit 987fe047c6
1 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ void Analyzer::Base::updateBandSize(const int scopeSize) {
barkband_table_.clear();
int barkband = 0;
for (int i = 0; i < bands_ + 1; ++i) {
for (int i = 0; i < bands_; ++i) {
if (barkband < sBarkBandCount - 1 &&
BandFrequency(i) >= sBarkBands[barkband]) {
barkband++;
@ -226,7 +226,7 @@ QColor Analyzer::Base::getPsychedelicColor(const Scope& scope,
// Calculate total magnitudes for different bark bands.
double bands[sBarkBandCount]{};
for (int i = 0; i < barkband_table_.size(); ++i) {
for (int i = 0; i < scope.size(); ++i) {
bands[barkband_table_[i]] += scope[i];
}