changeset 233:4b272c839f7e

Avoid failing when we have no features
author Chris Cannam
date Fri, 10 Jun 2016 13:56:05 +0100
parents 50a9c8eb4cac
children 7c1381b8182d 4d0e9225c179
files src/Matcher.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/Matcher.cpp	Fri Jun 10 11:50:31 2016 +0100
+++ b/src/Matcher.cpp	Fri Jun 10 13:56:05 2016 +0100
@@ -517,8 +517,11 @@
 Matcher::getMemoryStats() const
 {
     MemoryStats stats;
-    stats.features_k =
-        k(m_features.size() * m_features[0].size() * sizeof(featurebin_t));
+    stats.features_k = 0.0;
+    if (!m_features.empty()) {
+        stats.features_k =
+            k(m_features.size() * m_features[0].size() * sizeof(featurebin_t));
+    }
     
     size_t cells = 0;
     for (const auto &d: m_distance) {