Fix a crash when running in Ardour 5

The current code contains a check that avoids setting the current
FM engine if the engine type is the same as the one that's already
set. The problem is that if the target engine type is `0` and the
current engine has never been set, the engine will never be set.
This leads to a NULL pointer dereference when the engine is accessed
later during rendering.

The fix is to change the logic slightly so that the set operation
isn't avoided if the current code is NULL.
pull/1/head
Mark Raynsford 7 years ago
parent 1d6239f89d
commit 1cdd7eee3e
No known key found for this signature in database
GPG Key ID: 0F15B7D06FA80CB8
  1. 2
      src/dexed.cpp

@ -801,7 +801,7 @@ uint8_t Dexed::getEngineType() {
void Dexed::setEngineType(uint8_t tp) {
TRACE("settings engine %d", tp);
if(engineType==tp)
if(engineType==tp && controllers.core!=NULL)
return;
switch (tp) {

Loading…
Cancel
Save