diff plugin/DSSIPluginInstance.cpp @ 973:7aa9088e9bcd

Fix various slightly dodgy derefs and the like (from coverity scan)
author Chris Cannam
date Wed, 03 Sep 2014 11:20:18 +0100
parents 2d53205f70cd
children c598b1d880f2
line wrap: on
line diff
--- a/plugin/DSSIPluginInstance.cpp	Wed Sep 03 11:10:22 2014 +0100
+++ b/plugin/DSSIPluginInstance.cpp	Wed Sep 03 11:20:18 2014 +0100
@@ -64,6 +64,7 @@
     RealTimePluginInstance(factory, identifier),
     m_client(clientId),
     m_position(position),
+    m_instanceHandle(0),
     m_descriptor(descriptor),
     m_programCacheValid(false),
     m_eventBuffer(EVENT_BUFFER_SIZE),
@@ -146,6 +147,7 @@
 {
     ParameterList list;
     LADSPAPluginFactory *f = dynamic_cast<LADSPAPluginFactory *>(m_factory);
+    if (!f) return list;
     
     for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) {
         
@@ -988,7 +990,7 @@
     if (count == 0) count = m_blockSize;
 
     bool needLock = false;
-    if (m_descriptor->select_program) needLock = true;
+    if (m_descriptor && m_descriptor->select_program) needLock = true;
 
     if (needLock) {
 	if (!m_processLock.tryLock()) {