changeset 502:d129bf797f24

Avoid buffer underflow
author Chris Cannam
date Tue, 30 Jan 2018 15:28:15 +0000
parents 4a86f866bb6b
children 13e551657422 8742125177ae
files examples/FixedTempoEstimator.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/examples/FixedTempoEstimator.cpp	Mon Dec 11 13:22:11 2017 +0000
+++ b/examples/FixedTempoEstimator.cpp	Tue Jan 30 15:28:15 2018 +0000
@@ -529,6 +529,8 @@
 
     for (int i = p0; i <= p1 && i+1 < n/2; ++i) {
 
+        if (i < 1) continue;
+        
         if (m_fr[i] > m_fr[i-1] &&
             m_fr[i] > m_fr[i+1]) {