1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

imgproc(ocl): fix resizeLN, avoid integer overflow

This commit is contained in:
Alexander Alekhin
2021-12-09 20:23:35 +00:00
parent 35ff9af6ce
commit 659cf7249e
3 changed files with 20 additions and 5 deletions
+14
View File
@@ -327,6 +327,20 @@ OCL_TEST_P(Resize, Mat)
}
}
OCL_TEST(Resize, overflow_21198)
{
Mat src(Size(600, 600), CV_16UC3, Scalar::all(32768));
UMat src_u;
src.copyTo(src_u);
Mat dst;
cv::resize(src, dst, Size(1024, 1024), 0, 0, INTER_LINEAR);
UMat dst_u;
cv::resize(src_u, dst_u, Size(1024, 1024), 0, 0, INTER_LINEAR);
EXPECT_LE(cv::norm(dst_u, dst, NORM_INF), 1.0f);
}
/////////////////////////////////////////////////////////////////////////////////////////////////
// remap