mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Fixed several issues found by static analysis tools
This commit is contained in:
@@ -859,6 +859,13 @@ public:
|
||||
*/
|
||||
TermCriteria(int type, int maxCount, double epsilon);
|
||||
|
||||
inline bool isValid() const
|
||||
{
|
||||
const bool isCount = (type & COUNT) && maxCount > 0;
|
||||
const bool isEps = (type & EPS) && !cvIsNaN(epsilon);
|
||||
return isCount || isEps;
|
||||
}
|
||||
|
||||
int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
|
||||
int maxCount; //!< the maximum number of iterations/elements
|
||||
double epsilon; //!< the desired accuracy
|
||||
|
||||
@@ -629,7 +629,6 @@ CV_INLINE int cvIplDepth( int type )
|
||||
#define CV_TYPE_NAME_MATND "opencv-nd-matrix"
|
||||
|
||||
#define CV_MAX_DIM 32
|
||||
#define CV_MAX_DIM_HEAP 1024
|
||||
|
||||
/**
|
||||
@deprecated consider using cv::Mat instead
|
||||
|
||||
@@ -1725,8 +1725,8 @@ cvPtr1D( const CvArr* arr, int idx, int* _type )
|
||||
else
|
||||
{
|
||||
int i, n = m->dims;
|
||||
CV_DbgAssert( n <= CV_MAX_DIM_HEAP );
|
||||
int _idx[CV_MAX_DIM_HEAP];
|
||||
CV_DbgAssert( n <= CV_MAX_DIM );
|
||||
int _idx[CV_MAX_DIM];
|
||||
|
||||
for( i = n - 1; i >= 0; i-- )
|
||||
{
|
||||
|
||||
@@ -302,7 +302,7 @@ static void* icvReadSparseMat( CvFileStorage* fs, CvFileNode* node )
|
||||
CvFileNode* sizes_node;
|
||||
CvSeqReader reader;
|
||||
CvSeq* elements;
|
||||
int sizes[CV_MAX_DIM_HEAP], dims, elem_type, cn;
|
||||
int sizes[CV_MAX_DIM], dims, elem_type, cn;
|
||||
int i;
|
||||
|
||||
sizes_node = cvGetFileNodeByName( fs, node, "sizes" );
|
||||
@@ -327,7 +327,7 @@ static void* icvReadSparseMat( CvFileStorage* fs, CvFileNode* node )
|
||||
mat = cvCreateSparseMat( dims, sizes, elem_type );
|
||||
|
||||
cn = CV_MAT_CN(elem_type);
|
||||
int idx[CV_MAX_DIM_HEAP];
|
||||
int idx[CV_MAX_DIM];
|
||||
elements = data->data.seq;
|
||||
cvStartReadRawData( fs, data, &reader );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user