diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index b1777a7752..57e40f976f 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -2435,7 +2435,7 @@ static void checkRoot(Mat& r, T re, T im) { for (int i = 0; i < r.cols*r.rows; i++) { - Vec v = *(Vec*)r.ptr(i); + Vec& v = *(Vec*)r.ptr(i); if (fabs(re - v[0]) < 1e-6 && fabs(im - v[1]) < 1e-6) { v[0] = std::numeric_limits::quiet_NaN();