diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 92301cf3b472cb9890ee0c8c67b0d3d761f1c161..c19caf9020adf7d23863d77481437ae334e5858f 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -431,7 +431,7 @@ template inline _Tp* Mat::ptr(int y) template inline const _Tp* Mat::ptr(int y) const { - CV_DbgAssert( y == 0 || (data && dims >= 1 && data && (unsigned)y < (unsigned)size.p[0]) ); + CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) ); return (const _Tp*)(data + step.p[0]*y); } diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 11a4b02660ba9937ec1a66f6faefe5a367306476..7560c2e59e2acf8ef634cf3a23a9c7b68fa8c1d9 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -184,7 +184,7 @@ static void finalizeHdr(Mat& m) void Mat::create(int d, const int* _sizes, int _type) { int i; - CV_Assert(0 <= d && _sizes && d <= CV_MAX_DIM && _sizes); + CV_Assert(0 <= d && d <= CV_MAX_DIM && _sizes); _type = CV_MAT_TYPE(_type); if( data && (d == dims || (d == 1 && dims <= 2)) && _type == type() )