changeset 46:eafb3a7f80fb

Fix bin overrun in bpmToBin (proximate cause of bug #1054)
author Chris Cannam
date Mon, 29 Sep 2014 16:19:12 +0100
parents e6a43500629b
children cb79f27f0748
files TempogramPlugin.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/TempogramPlugin.cpp	Thu Sep 25 18:42:35 2014 +0100
+++ b/TempogramPlugin.cpp	Mon Sep 29 16:19:12 2014 +0100
@@ -577,7 +577,7 @@
     int bin = floor((float)m_tempogramFftLength*w/sampleRate + 0.5);
     
     if(bin < 0) bin = 0;
-    else if(bin > m_tempogramFftLength/2.0f) bin = m_tempogramFftLength;
+    else if(bin > m_tempogramFftLength/2.0f) bin = m_tempogramFftLength/2.0f;
     
     return bin;
 }