From 51f52ca7b6dacf698741fdb1e9afbb645777d6d0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 20 Mar 2017 20:37:37 +0100 Subject: 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. --- src/server/PortImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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: -- cgit v1.2.1