changeset 285:9abf7455a1a3

* Fix crash when an adapter's createPlugin() fails in getDescriptor()
author cannam
date Mon, 17 Aug 2009 13:42:55 +0000
parents 1ed95908a397
children 91574fc544db
files src/vamp-sdk/PluginAdapter.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-sdk/PluginAdapter.cpp	Mon Jun 15 14:30:05 2009 +0000
+++ b/src/vamp-sdk/PluginAdapter.cpp	Mon Aug 17 13:42:55 2009 +0000
@@ -168,6 +168,11 @@
     if (m_populated) return &m_descriptor;
 
     Plugin *plugin = m_base->createPlugin(48000);
+  
+    if (!plugin) {
+        std::cerr << "PluginAdapterBase::Impl::getDescriptor: Failed to create plugin" << std::endl;
+        return 0;
+    }
 
     if (plugin->getVampApiVersion() != VAMP_API_VERSION) {
         std::cerr << "Vamp::PluginAdapterBase::Impl::getDescriptor: ERROR: "