summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-20 20:37:37 +0100
committerDavid Robillard <d@drobilla.net>2017-03-20 20:37:37 +0100
commit51f52ca7b6dacf698741fdb1e9afbb645777d6d0 (patch)
tree3df5da017854d7bc9d8aa51e3f95bccd6e05fab5 /src/server
parent7e58577eb0474f304defeff0400e84477a7e88d5 (diff)
downloadingen-51f52ca7b6dacf698741fdb1e9afbb645777d6d0.tar.gz
ingen-51f52ca7b6dacf698741fdb1e9afbb645777d6d0.tar.bz2
ingen-51f52ca7b6dacf698741fdb1e9afbb645777d6d0.zip
Fix crash when setting control ports without a value buffer
Control ports should always have a value buffer for some value of "should", but crashing is never good in any case.
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PortImpl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index a9c1aefe..9a701d39 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -243,7 +243,9 @@ PortImpl::set_voice_value(const RunContext& context,
{
switch (_type.id()) {
case PortType::CONTROL:
- ((LV2_Atom_Float*)buffer(voice)->value())->body = value;
+ if (buffer(voice)->value()) {
+ ((LV2_Atom_Float*)buffer(voice)->value())->body = value;
+ }
_voices->at(voice).set_state.set(context, context.start(), value);
break;
case PortType::AUDIO: