1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

core: don't allow reallocation in add/div/sub/bitwise aug operators

This commit is contained in:
Alexander Alekhin
2020-03-06 12:52:00 +00:00
parent 4f288a1e28
commit 3a2f40ac6f
2 changed files with 57 additions and 40 deletions
+17
View File
@@ -1519,6 +1519,23 @@ TEST(Core_sortIdx, regression_8941)
"expected=" << std::endl << expected;
}
TEST(Core_Mat, augmentation_operations_9688)
{
{
Mat x(1, 1, CV_64FC1, 1.0f);
Mat p(1, 4, CV_64FC1, 5.0f);
EXPECT_ANY_THROW(
x += p;
) << x;
}
{
Mat x(1, 1, CV_64FC1, 1.0f);
Mat p(1, 4, CV_64FC1, 5.0f);
EXPECT_ANY_THROW(
x -= p;
) << x;
}
}
//These tests guard regressions against running MatExpr
//operations on empty operands and giving bogus