From 0f357262166375b68a83a9472ec916939bffb26c Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sun, 18 Feb 2024 12:56:33 +0000 Subject: [PATCH] Fix crash when phase_offset not set --- source/src/node/oscillators/sine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/src/node/oscillators/sine.cpp b/source/src/node/oscillators/sine.cpp index 72aa5925..3a3c343c 100644 --- a/source/src/node/oscillators/sine.cpp +++ b/source/src/node/oscillators/sine.cpp @@ -77,7 +77,10 @@ void SineOscillator::process(Buffer &out, int num_frames) #else for (int frame = 0; frame < num_frames; frame++) { - out[channel][frame] += this->phase_offset->out[channel][frame]; + if (this->phase_offset) + { + out[channel][frame] += this->phase_offset->out[channel][frame]; + } out[channel][frame] = sinf(out[channel][frame]); } #endif