From 7aa26482eb2a033ab77e8041da017a625306b783 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sat, 30 Jan 2021 04:56:53 -0600 Subject: [PATCH] Bug 1806 - Extreme negative settings in Change Tempo cause an "apparent" hang/freeze --- src/effects/SoundTouchEffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/effects/SoundTouchEffect.cpp b/src/effects/SoundTouchEffect.cpp index 65cd29974..ac79d1761 100644 --- a/src/effects/SoundTouchEffect.cpp +++ b/src/effects/SoundTouchEffect.cpp @@ -213,8 +213,8 @@ bool EffectSoundTouch::ProcessOne(WaveTrack *track, auto s = start; while (s < end) { //Get a block of samples (smaller than the size of the buffer) - const auto block = - limitSampleBufferSize( track->GetBestBlockSize(s), end - s ); + const auto block = wxMin(8192, + limitSampleBufferSize( track->GetBestBlockSize(s), end - s )); //Get the samples from the track and put them in the buffer track->Get((samplePtr)buffer.get(), floatSample, s, block);