From 6db9d312ec130b0de1cdbb6cf626b73b039cae28 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 20 Jan 2022 00:43:08 -0500 Subject: [PATCH] fix crash when previewing size 0 waves --- src/engine/engine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 919f2fdbb..23d24b6bd 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -2832,6 +2832,10 @@ void DivEngine::previewWave(int wave, int note) { isBusy.unlock(); return; } + if (song.wave[wave]->len<=0) { + isBusy.unlock(); + return; + } blip_clear(samp_bb); blip_set_rates(samp_bb,song.wave[wave]->len*(27.5*pow(2.0,(double)(note+3)/12.0)),got.rate); samp_prevSample=0;