]> git.sesse.net Git - kdenlive/commitdiff
fix coverity 1134134 1134135 (div by 0)
authorVincent PINON <vincent.pinon@laposte.net>
Sun, 29 Dec 2013 14:38:46 +0000 (15:38 +0100)
committerVincent PINON <vincent.pinon@laposte.net>
Sun, 29 Dec 2013 14:38:46 +0000 (15:38 +0100)
src/lib/audio/fftCorrelation.cpp

index 9c1a893a0310c2fc192b5d6ef38021e29f1b64dd..139ea203d0daaac1c3a62b3949e5628222cf223b 100644 (file)
@@ -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]);