diff src/Silvet.cpp @ 364:78ed74fa177b

Fix crash in finetune mode sometimes caused by note remaining on while column falls below threshold
author Chris Cannam
date Wed, 07 Oct 2015 16:47:31 +0100
parents 0af00da90a40
children
line wrap: on
line diff
--- a/src/Silvet.cpp	Tue Sep 15 14:39:16 2015 +0100
+++ b/src/Silvet.cpp	Wed Oct 07 16:47:31 2015 +0100
@@ -1020,7 +1020,12 @@
         active[j] = strength;
 
         if (shiftCount > 1) {
-            activeShifts[j] = bestShifts[j];
+            if (!bestShifts.empty()) {
+                activeShifts[j] = bestShifts[j];
+            } else {
+                // can happen if column was below threshold
+                activeShifts[j] = 0;
+            }
         }
     }