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

core: fix adjustROI behavior on indexes overflow

This commit is contained in:
Vladislav Sovrasov
2017-02-22 14:00:22 +03:00
parent 526220a171
commit 14451f3f06
4 changed files with 42 additions and 4 deletions
+14
View File
@@ -1240,3 +1240,17 @@ protected:
};
TEST(Core_SparseMat, iterations) { CV_SparseMatTest test; test.safe_run(); }
TEST(MatTestRoi, adjustRoiOverflow)
{
Mat m(15, 10, CV_32S);
Mat roi(m, cv::Range(2, 10), cv::Range(3,6));
int rowsInROI = roi.rows;
roi.adjustROI(1, 0, 0, 0);
ASSERT_EQ(roi.rows, rowsInROI + 1);
roi.adjustROI(-m.rows, -m.rows, 0, 0);
ASSERT_EQ(roi.rows, m.rows);
}