diff Peaks.cpp @ 18:55969570044e

Fix crashes & valgrind warnings in plugin tester
author Chris Cannam
date Fri, 14 Oct 2011 10:44:38 +0100
parents 887c629502a9
children 6afcb5edd7ab
line wrap: on
line diff
--- a/Peaks.cpp	Fri Oct 14 09:59:53 2011 +0100
+++ b/Peaks.cpp	Fri Oct 14 10:44:38 2011 +0100
@@ -58,6 +58,7 @@
     vector<int> peaks;
     int maxp = 0;
     int mid = 0;
+    if (data.empty()) return peaks;
     int end = data.size();
     double av = data[0];
     while (mid < end) {