diff --git a/modules/core/include/opencv2/core/mat.inl.hpp b/modules/core/include/opencv2/core/mat.inl.hpp index 4a32de165a..b3b7110cbc 100644 --- a/modules/core/include/opencv2/core/mat.inl.hpp +++ b/modules/core/include/opencv2/core/mat.inl.hpp @@ -1634,14 +1634,14 @@ Mat_<_Tp> Mat_<_Tp>::operator()(const std::vector& ranges) const template inline _Tp* Mat_<_Tp>::operator [](int y) { - CV_DbgAssert( 0 <= y && y < rows ); + CV_DbgAssert( 0 <= y && y < size.p[0] ); return (_Tp*)(data + y*step.p[0]); } template inline const _Tp* Mat_<_Tp>::operator [](int y) const { - CV_DbgAssert( 0 <= y && y < rows ); + CV_DbgAssert( 0 <= y && y < size.p[0] ); return (const _Tp*)(data + y*step.p[0]); }