Skip to content

Commit

Permalink
Fix crash when phase_offset not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Feb 18, 2024
1 parent 28a78e4 commit 0f35726
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/src/node/oscillators/sine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f35726

Please sign in to comment.