diff src/vamp-sdk/PluginAdapter.cpp @ 285:9abf7455a1a3

* Fix crash when an adapter's createPlugin() fails in getDescriptor()
author cannam
date Mon, 17 Aug 2009 13:42:55 +0000
parents 6579e441f2fe
children 34754c776530
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: "