diff src/vamp-sdk/PluginAdapter.cpp @ 240:7b90fe049d04

* Add --list-full to "simple" Vamp host
author cannam
date Mon, 10 Nov 2008 16:47:41 +0000
parents 7b12c3decc42
children 6579e441f2fe
line wrap: on
line diff
--- a/src/vamp-sdk/PluginAdapter.cpp	Mon Nov 10 12:39:19 2008 +0000
+++ b/src/vamp-sdk/PluginAdapter.cpp	Mon Nov 10 16:47:41 2008 +0000
@@ -661,7 +661,12 @@
     desc->hasFixedBinCount = od.hasFixedBinCount;
     desc->binCount = od.binCount;
 
-    if (od.hasFixedBinCount && od.binCount > 0) {
+    if (od.hasFixedBinCount && od.binCount > 0
+        // We would like to do "&& !od.binNames.empty()" here -- but we
+        // can't, because it will crash older versions of the host adapter
+        // which try to copy the names across whenever the bin count is
+        // non-zero, regardless of whether they exist or not
+        ) {
         desc->binNames = (const char **)
             malloc(od.binCount * sizeof(const char *));