[QGIS Commit] r11509 - trunk/qgis/src/plugins/interpolation

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Aug 26 07:56:42 EDT 2009


Author: mhugent
Date: 2009-08-26 07:56:41 -0400 (Wed, 26 Aug 2009)
New Revision: 11509

Modified:
   trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp
   trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp
Log:
Fix for uninitialised variable in interpolator and for possible division by zero

Modified: trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp	2009-08-26 11:43:51 UTC (rev 11508)
+++ trunk/qgis/src/plugins/interpolation/qgsidwinterpolator.cpp	2009-08-26 11:56:41 UTC (rev 11509)
@@ -62,6 +62,11 @@
     sumDenominator += currentWeight;
   }
 
+  if ( sumDenominator == 0.0 )
+  {
+    return 1;
+  }
+
   result = sumCounter / sumDenominator;
   return 0;
 }

Modified: trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp	2009-08-26 11:43:51 UTC (rev 11508)
+++ trunk/qgis/src/plugins/interpolation/qgsinterpolator.cpp	2009-08-26 11:56:41 UTC (rev 11509)
@@ -28,7 +28,7 @@
 #define isnan(f) _isnan(f)
 #endif
 
-QgsInterpolator::QgsInterpolator( const QList<LayerData>& layerData ): mLayerData( layerData )
+QgsInterpolator::QgsInterpolator( const QList<LayerData>& layerData ): mDataIsCached( false ), mLayerData( layerData )
 {
 
 }



More information about the QGIS-commit mailing list