From 533ccaa23ca82bce45c6fd54580f2d2fdc0c34fa Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sat, 12 Mar 2022 17:21:55 -0500 Subject: Avoid divide-by-zero when frequency set to 0 --- src/synth.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/synth.c b/src/synth.c index 9c974e5..41522a6 100644 --- a/src/synth.c +++ b/src/synth.c @@ -94,8 +94,14 @@ static ssize_t synth_fill(xas_synth *synth, xas_audio_stream *stream) { size_t i; - for (i=0; isample(synth); + if (synth->frequency > 0) { + for (i=0; isample(synth); + } + } else { + for (i=0; i