Index: libs/vamp-plugins/OnsetDetect.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- libs/vamp-plugins/OnsetDetect.cpp	(revision b7e8d6f13117b824b66f199b430161c4aae96c3e)
+++ libs/vamp-plugins/OnsetDetect.cpp	(revision )
@@ -452,31 +452,33 @@
         ppSrc[i] = m_d->dfOutput[i];
     }
 
+    if (ppParams.length >= 3 * ppParams.LPOrd) {
-    vector<int> onsets;
-    peakPicker.process(ppSrc, ppParams.length, onsets);
+        vector<int> onsets;
+        peakPicker.process(ppSrc, ppParams.length, onsets);
 
-    for (size_t i = 0; i < onsets.size(); ++i) {
+        for (size_t i = 0; i < onsets.size(); ++i) {
 
-        size_t index = onsets[i];
+            size_t index = onsets[i];
 
-        if (m_dfType != DF_BROADBAND) {
-            double prevDiff = 0.0;
-            while (index > 1) {
+            if (m_dfType != DF_BROADBAND) {
+                double prevDiff = 0.0;
+                while (index > 1) {
-                double diff = ppSrc[index] - ppSrc[index-1];
+                    double diff = ppSrc[index] - ppSrc[index - 1];
-                if (diff < prevDiff * 0.9) break;
-                prevDiff = diff;
-                --index;
-            }
-        }
+                    if (diff < prevDiff * 0.9) break;
+                    prevDiff = diff;
+                    --index;
+                }
+            }
 
-	size_t frame = index * m_d->dfConfig.stepSize;
+            size_t frame = index * m_d->dfConfig.stepSize;
 
-	Feature feature;
-	feature.hasTimestamp = true;
-	feature.timestamp = m_d->origin + Vamp::RealTime::frame2RealTime
-	    (frame, lrintf(m_inputSampleRate));
+            Feature feature;
+            feature.hasTimestamp = true;
+            feature.timestamp = m_d->origin + Vamp::RealTime::frame2RealTime
+                    (frame, lrintf(m_inputSampleRate));
 
-	returnFeatures[0].push_back(feature); // onsets are output 0
+            returnFeatures[0].push_back(feature); // onsets are output 0
+        }
     }
 
     for (unsigned int i = 0; i < ppParams.length; ++i) {
