@@ -1620,7 +1620,7 @@ void QgsRasterLayer::drawSingleBandPseudoColor(QPainter * theQPainter,
16201620 myQImage.setAlphaBuffer (true );
16211621 myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
16221622
1623- // calculate the adjusted matrix stats - which come into affect if the user has chosen
1623+ // calculate the adjusted matrix stats - which come into effect if the user has chosen
16241624 QgsRasterBandStats myAdjustedRasterBandStats = getRasterBandStats (theBandNoInt);
16251625
16261626 int myRedInt = 0 ;
@@ -2829,7 +2829,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
28292829 double myDouble = readValue ( myData, myDataType, iX + iY * myXBlockSize );
28302830
28312831 if ( fabs (myDouble - noDataValueDouble) < myPrecision ||
2832- myDouble < GDALminimum )
2832+ myDouble < GDALminimum || myDouble != myDouble )
28332833 {
28342834 continue ; // NULL
28352835 }
@@ -2854,7 +2854,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
28542854 myRasterBandStats.maxValDouble = myDouble;
28552855 }
28562856 // only increment the running total if it is not a nodata value
2857- if (myDouble != noDataValueDouble)
2857+ if (myDouble != noDataValueDouble || myDouble != myDouble )
28582858 {
28592859 myRasterBandStats.sumDouble += myDouble;
28602860 ++myRasterBandStats.elementCountInt ;
@@ -2902,7 +2902,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
29022902 double myDouble = readValue ( myData, myDataType, iX + iY * myXBlockSize );
29032903
29042904 if ( fabs (myDouble - noDataValueDouble) < myPrecision ||
2905- myDouble < GDALminimum )
2905+ myDouble < GDALminimum || myDouble != myDouble )
29062906 {
29072907 continue ; // NULL
29082908 }
0 commit comments