@@ -5699,13 +5699,20 @@ double norm( const SparseMat& src, int normType )
5699
5699
{
5700
5700
if ( normType == NORM_INF )
5701
5701
for ( i = 0 ; i < N; i++, ++it )
5702
+ {
5703
+ CV_Assert (it.ptr );
5702
5704
result = std::max (result, std::abs ((double )it.value <float >()));
5705
+ }
5703
5706
else if ( normType == NORM_L1 )
5704
5707
for ( i = 0 ; i < N; i++, ++it )
5708
+ {
5709
+ CV_Assert (it.ptr );
5705
5710
result += std::abs (it.value <float >());
5711
+ }
5706
5712
else
5707
5713
for ( i = 0 ; i < N; i++, ++it )
5708
5714
{
5715
+ CV_Assert (it.ptr );
5709
5716
double v = it.value <float >();
5710
5717
result += v*v;
5711
5718
}
@@ -5714,13 +5721,20 @@ double norm( const SparseMat& src, int normType )
5714
5721
{
5715
5722
if ( normType == NORM_INF )
5716
5723
for ( i = 0 ; i < N; i++, ++it )
5724
+ {
5725
+ CV_Assert (it.ptr );
5717
5726
result = std::max (result, std::abs (it.value <double >()));
5727
+ }
5718
5728
else if ( normType == NORM_L1 )
5719
5729
for ( i = 0 ; i < N; i++, ++it )
5730
+ {
5731
+ CV_Assert (it.ptr );
5720
5732
result += std::abs (it.value <double >());
5733
+ }
5721
5734
else
5722
5735
for ( i = 0 ; i < N; i++, ++it )
5723
5736
{
5737
+ CV_Assert (it.ptr );
5724
5738
double v = it.value <double >();
5725
5739
result += v*v;
5726
5740
}
@@ -5747,6 +5761,7 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi
5747
5761
float minval = FLT_MAX, maxval = -FLT_MAX;
5748
5762
for ( i = 0 ; i < N; i++, ++it )
5749
5763
{
5764
+ CV_Assert (it.ptr );
5750
5765
float v = it.value <float >();
5751
5766
if ( v < minval )
5752
5767
{
@@ -5769,6 +5784,7 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi
5769
5784
double minval = DBL_MAX, maxval = -DBL_MAX;
5770
5785
for ( i = 0 ; i < N; i++, ++it )
5771
5786
{
5787
+ CV_Assert (it.ptr );
5772
5788
double v = it.value <double >();
5773
5789
if ( v < minval )
5774
5790
{
0 commit comments