Mercurial > hg > vamp-plugin-sdk
diff vamp-sdk/PluginHostAdapter.cpp @ 7:c66551966b5f
* Fix a couple of memory management and corruption bugs
* Some textual fixes
author | cannam |
---|---|
date | Fri, 31 Mar 2006 17:39:49 +0000 |
parents | 8f10d35a4090 |
children | 44113b1e296b |
line wrap: on
line diff
--- a/vamp-sdk/PluginHostAdapter.cpp Fri Mar 31 16:26:28 2006 +0000 +++ b/vamp-sdk/PluginHostAdapter.cpp Fri Mar 31 17:39:49 2006 +0000 @@ -223,7 +223,7 @@ d.hasFixedValueCount = sd->hasFixedValueCount; d.valueCount = sd->valueCount; for (unsigned int j = 0; j < sd->valueCount; ++j) { - d.valueNames.push_back(sd->valueNames[i] ? sd->valueNames[i] : ""); + d.valueNames.push_back(sd->valueNames[j] ? sd->valueNames[j] : ""); } d.hasKnownExtents = sd->hasKnownExtents; d.minValue = sd->minValue; @@ -286,6 +286,8 @@ PluginHostAdapter::convertFeatures(VampFeatureList **features, FeatureSet &fs) { + if (!features) return; + for (unsigned int i = 0; features[i]; ++i) { VampFeatureList &list = *features[i]; @@ -302,8 +304,10 @@ for (unsigned int k = 0; k < list.features[j].valueCount; ++k) { feature.values.push_back(list.features[j].values[k]); } - - feature.label = list.features[j].label; + + if (list.features[j].label) { + feature.label = list.features[j].label; + } fs[i].push_back(feature); }