Skip to content
Permalink
Browse files

Fix for uninitialised variable in interpolator and for possible divis…

…ion by zero

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11509 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Aug 26, 2009
1 parent b0c24d5 commit a25a5282c866dcc6ae06372d3ef8fa2cda93506b
@@ -62,6 +62,11 @@ int QgsIDWInterpolator::interpolatePoint( double x, double y, double& result )
sumDenominator += currentWeight;
}

if ( sumDenominator == 0.0 )
{
return 1;
}

result = sumCounter / sumDenominator;
return 0;
}
@@ -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 )
{

}

0 comments on commit a25a528

Please sign in to comment.
You can’t perform that action at this time.