1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 06:43:01 +04:00

Fixed several issues found by static analysis in core module

This commit is contained in:
Maksim Shabunin
2017-05-17 17:36:48 +03:00
parent c5e9d1adae
commit b04ed5956e
13 changed files with 139 additions and 94 deletions
+2 -1
View File
@@ -545,7 +545,7 @@ cvCreateSparseMat( int dims, const int* sizes, int type )
if( pix_size == 0 )
CV_Error( CV_StsUnsupportedFormat, "invalid array data type" );
if( dims <= 0 || dims > CV_MAX_DIM_HEAP )
if( dims <= 0 || dims > CV_MAX_DIM )
CV_Error( CV_StsOutOfRange, "bad number of dimensions" );
if( !sizes )
@@ -1839,6 +1839,7 @@ cvPtr2D( const CvArr* arr, int y, int x, int* _type )
}
else if( CV_IS_SPARSE_MAT( arr ))
{
CV_Assert(((CvSparseMat*)arr)->dims == 2);
int idx[] = { y, x };
ptr = icvGetNodePtr( (CvSparseMat*)arr, idx, _type, 1, 0 );
}