From 17a63e99d58053b0fbde8b69d7cc76a38119ce70 Mon Sep 17 00:00:00 2001 From: Olli Date: Wed, 3 Mar 2021 18:11:45 +0200 Subject: [PATCH] Fix bug with too small initial skipFract value Fix bug with too small initial skipFract value with certain processing parameter set: replaces assert with assignment that corrects the situation. --- source/SoundTouch/TDStretch.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/SoundTouch/TDStretch.cpp b/source/SoundTouch/TDStretch.cpp index 076888f..243f7cc 100644 --- a/source/SoundTouch/TDStretch.cpp +++ b/source/SoundTouch/TDStretch.cpp @@ -687,7 +687,10 @@ void TDStretch::processSamples() } #endif skipFract -= skip; - assert(nominalSkip >= -skipFract); + if (skipFract <= -nominalSkip) + { + skipFract = -nominalSkip; + } } // ... then copy sequence samples from 'inputBuffer' to output: