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

Merge pull request #12443 from DEEPIR:master

* simplify condition

* dims must > 0 or latter sz[dims-1] will underflow
This commit is contained in:
cyy
2018-09-07 04:09:39 +08:00
committed by Alexander Alekhin
parent f1f15841d7
commit 8b48c2a10c
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -258,7 +258,7 @@ void Mat::copyTo( OutputArray _dst ) const
UMat dst = _dst.getUMat();
CV_Assert(dst.u != NULL);
size_t i, sz[CV_MAX_DIM] = {0}, dstofs[CV_MAX_DIM], esz = elemSize();
CV_Assert(dims >= 0 && dims < CV_MAX_DIM);
CV_Assert(dims > 0 && dims < CV_MAX_DIM);
for( i = 0; i < (size_t)dims; i++ )
sz[i] = size.p[i];
sz[dims-1] *= esz;