From 7ea1bf3cf02c92955f0407c82097d1cabf00f2cb Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 20 May 2014 13:54:00 +0400 Subject: [PATCH] Fixed several problems found by PVS-Studio. This fixes all problems from the article "Checking OpenCV with PVS-Studio" that are not already fixed and are not in 3rdparty or the legacy module. The problems fixed are two instances of useless code and one instance of unspecified behavior (right-shifting a negative number). --- modules/core/test/test_math.cpp | 2 +- modules/imgproc/src/contours.cpp | 2 +- modules/imgproc/test/test_imgwarp_strict.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index 5dec97e8c1..d2c0695306 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -1353,7 +1353,7 @@ void Core_DetTest::get_test_array_types_and_sizes( int test_case_idx, vector> 1; + new_mask = INT_MIN / 2; } for( ; y < height; y++, img += step ) diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp index 064ba93568..c122d0b58b 100644 --- a/modules/imgproc/test/test_imgwarp_strict.cpp +++ b/modules/imgproc/test/test_imgwarp_strict.cpp @@ -557,7 +557,6 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d xyD[r] = 0; for (int k = 0; k < ksize; ++k) xyD[r] += w[k] * xyS[k * cn + r]; - xyD[r] = xyD[r]; } } }