From f4462e7ecb75f64e524746e3bb7c62a5e973d965 Mon Sep 17 00:00:00 2001 From: Vincent PINON Date: Sun, 29 Dec 2013 15:38:46 +0100 Subject: [PATCH] fix coverity 1134134 1134135 (div by 0) --- src/lib/audio/fftCorrelation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/audio/fftCorrelation.cpp b/src/lib/audio/fftCorrelation.cpp index 9c1a893a..139ea203 100644 --- a/src/lib/audio/fftCorrelation.cpp +++ b/src/lib/audio/fftCorrelation.cpp @@ -48,8 +48,8 @@ void FFTCorrelation::correlate(const int64_t *left, const int leftSize, // Dividing by the max value is maybe not the best solution, but the // maximum value after correlation should not be larger than the longest // vector since each value should be at most 1 - int64_t maxLeft = 0; - int64_t maxRight = 0; + int64_t maxLeft = 1; + int64_t maxRight = 1; for (int i = 0; i < leftSize; ++i) { if (labs(left[i]) > maxLeft) { maxLeft = labs(left[i]); -- 2.39.2