# HG changeset patch # User Chris Cannam # Date 1517326095 0 # Node ID d129bf797f24a37e64d4fc189e2bb7be351bc576 # Parent 4a86f866bb6bea4fd2d749396021a3ca10c82de6 Avoid buffer underflow diff -r 4a86f866bb6b -r d129bf797f24 examples/FixedTempoEstimator.cpp --- 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]) {