Orcan Ogetbil 27e49b9
diff -rupN Clementine-1.3.1.org/src/analyzers/analyzerbase.cpp Clementine-1.3.1/src/analyzers/analyzerbase.cpp
Orcan Ogetbil 27e49b9
--- Clementine-1.3.1.org/src/analyzers/analyzerbase.cpp	2016-04-19 11:08:35.000000000 -0400
Orcan Ogetbil 098178c
+++ Clementine-1.3.1/src/analyzers/analyzerbase.cpp	2018-05-30 02:19:53.938791531 -0400
Orcan Ogetbil 098178c
@@ -106,6 +106,7 @@ void Analyzer::Base::paintEvent(QPaintEv
Orcan Ogetbil 098178c
       const Engine::Scope& thescope = engine_->scope(timeout_);
Orcan Ogetbil 098178c
       int i = 0;
Orcan Ogetbil 27e49b9
 
Orcan Ogetbil 098178c
+      lastScope_.resize(fht_->size());
Orcan Ogetbil 27e49b9
       // convert to mono here - our built in analyzers need mono, but the
Orcan Ogetbil 27e49b9
       // engines provide interleaved pcm
Orcan Ogetbil 098178c
       for (uint x = 0; static_cast<int>(x) < fht_->size(); ++x) {
Orcan Ogetbil 098178c
@@ -225,7 +226,7 @@ QColor Analyzer::Base::getPsychedelicCol
Orcan Ogetbil 098178c
   // Calculate total magnitudes for different bark bands.
Orcan Ogetbil 098178c
   double bands[sBarkBandCount]{};
Orcan Ogetbil 098178c
 
Orcan Ogetbil 098178c
-  for (int i = 0; i < barkband_table_.size(); ++i) {
Orcan Ogetbil 098178c
+  for (int i = 0; i < std::min(barkband_table_.size(), (int)scope.size()); ++i) {
Orcan Ogetbil 098178c
     bands[barkband_table_[i]] += scope[i];
Orcan Ogetbil 098178c
   }
Orcan Ogetbil 098178c