1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +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
+3 -3
View File
@@ -5786,10 +5786,10 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi
else
CV_Error( CV_StsUnsupportedFormat, "Only 32f and 64f are supported" );
if( _minidx )
if( _minidx && minidx )
for( i = 0; i < d; i++ )
_minidx[i] = minidx[i];
if( _maxidx )
if( _maxidx && maxidx )
for( i = 0; i < d; i++ )
_maxidx[i] = maxidx[i];
}
@@ -5898,7 +5898,7 @@ _IplImage::_IplImage(const cv::Mat& m)
CvSparseMat* cvCreateSparseMat(const cv::SparseMat& sm)
{
if( !sm.hdr )
if( !sm.hdr || sm.hdr->dims > (int)cv::SparseMat::MAX_DIM)
return 0;
CvSparseMat* m = cvCreateSparseMat(sm.hdr->dims, sm.hdr->size, sm.type());