Merge pull request #8988 from sovrasov:repeat_src_eq_dst_fix

This commit is contained in:
Vadim Pisarevsky 2017-06-26 21:58:26 +00:00
commit ef2e5a9f82
2 changed files with 10 additions and 0 deletions

View File

@ -856,6 +856,7 @@ void repeat(InputArray _src, int ny, int nx, OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_Assert(_src.getObj() != _dst.getObj());
CV_Assert( _src.dims() <= 2 );
CV_Assert( ny > 0 && nx > 0 );

View File

@ -145,3 +145,12 @@ TEST(Core_String, end_method_regression)
cv::String new_string(old_string.begin(), old_string.end());
EXPECT_EQ(6u, new_string.size());
}
TEST(Core_Copy, repeat_regression_8972)
{
Mat src = (Mat_<int>(1, 4) << 1, 2, 3, 4);
ASSERT_ANY_THROW({
repeat(src, 5, 1, src);
});
}