From a911a1e98689e763e1274f462c00e7c6fedd80f9 Mon Sep 17 00:00:00 2001 From: Olli Parviainen Date: Sat, 3 Oct 2020 16:58:00 +0300 Subject: [PATCH] Bugfix in integer version of calcCrossCorrAccumulate() Using "unsigned long" for "lnorm" variable that was yet made negative in very first step caused incorrect calculation result. Corrected the type to "long". Signed-off-by: Olli Parviainen --- source/SoundTouch/TDStretch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/SoundTouch/TDStretch.cpp b/source/SoundTouch/TDStretch.cpp index d381bb4..63e2be9 100644 --- a/source/SoundTouch/TDStretch.cpp +++ b/source/SoundTouch/TDStretch.cpp @@ -928,7 +928,7 @@ double TDStretch::calcCrossCorr(const short *mixingPos, const short *compare, do double TDStretch::calcCrossCorrAccumulate(const short *mixingPos, const short *compare, double &norm) { long corr; - unsigned long lnorm; + long lnorm; int i; // cancel first normalizer tap from previous round