From 9b5c0d19f855d984bda659e8e27b5ef07dbfc358 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 6 Jul 2009 01:07:51 +0200 Subject: [PATCH] RemoteVstPlugin: added more NULL checks Check for m_plugin being NULL in RemoteVstPlugin::inputCount(), RemoteVstPlugin::outputCount() and RemoteVstPlugin::pluginVersion(). Makes various VST's load properly now. Thanks to Oleg Sharonov for pointing this out. Signed-off-by: Tobias Doerffel --- plugins/vst_base/remote_vst_plugin.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/vst_base/remote_vst_plugin.cpp b/plugins/vst_base/remote_vst_plugin.cpp index 94adf2ad5..b1ade5525 100644 --- a/plugins/vst_base/remote_vst_plugin.cpp +++ b/plugins/vst_base/remote_vst_plugin.cpp @@ -166,8 +166,12 @@ public: // determine VST-version the plugin uses int pluginVersion( void ) const { - return m_plugin->dispatcher( m_plugin, + if( m_plugin ) + { + return m_plugin->dispatcher( m_plugin, effGetVendorVersion, 0, 0, NULL, 0.0f ); + } + return 0; } // determine name of plugin @@ -197,13 +201,21 @@ public: // number of inputs virtual int inputCount( void ) const { - return m_plugin->numInputs; + if( m_plugin ) + { + return m_plugin->numInputs; + } + return 0; } // number of outputs virtual int outputCount( void ) const { - return m_plugin->numOutputs; + if( m_plugin ) + { + return m_plugin->numOutputs; + } + return 0; } // has to be called as soon as input- or output-count changes