From 1c7a5e08a06a4f47c85eb0e58dec19e321897fee Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 29 Dec 2020 17:32:33 +0100 Subject: [PATCH] Check for null pointers in input parameter changes This is not allowed to be a null pointer, but the SDK's plugin validator will pass a null pointer anyways. --- src/common/serialization/vst3/process-data.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/serialization/vst3/process-data.cpp b/src/common/serialization/vst3/process-data.cpp index 1e805495..769470ff 100644 --- a/src/common/serialization/vst3/process-data.cpp +++ b/src/common/serialization/vst3/process-data.cpp @@ -143,7 +143,12 @@ YaProcessData::YaProcessData(const Steinberg::Vst::ProcessData& process_data) symbolic_sample_size(process_data.symbolicSampleSize), num_samples(process_data.numSamples), outputs_num_channels(process_data.numOutputs), - input_parameter_changes(*process_data.inputParameterChanges), + // Even though `ProcessData::inputParamterChanges` is mandatory, the VST3 + // validator will pass a null pointer here + input_parameter_changes( + process_data.inputParameterChanges + ? YaParameterChanges(*process_data.inputParameterChanges) + : YaParameterChanges()), output_parameter_changes_supported(process_data.outputParameterChanges), input_events(process_data.inputEvents ? std::make_optional( *process_data.inputEvents)