Skip to content
Permalink
Browse files

[rastercalc] Fix use of uninitialized variable

  • Loading branch information
nyalldawson committed Jun 15, 2015
1 parent 93649bc commit 00e047395c48ebeecb7549e7e2e37851e3cfafba
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/analysis/raster/qgsrastercalculator.cpp
@@ -124,7 +124,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
}

QgsRasterMatrix resultMatrix;
resultMatrix.setNodataValue( -FLT_MAX );
resultMatrix.setNodataValue( outputNodataValue );

//read / write line by line
for ( int i = 0; i < mNumOutputRows; ++i )
@@ -146,8 +146,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )

for ( int j = 0; j < mNumOutputColumns; ++j )
{
double result = resultIsNumber ? resultMatrix.number() : resultMatrix.data()[j];
calcData[j] = ( calcData[j] == resultMatrix.nodataValue() ? outputNodataValue : ( float ) result );
calcData[j] = ( float )( resultIsNumber ? resultMatrix.number() : resultMatrix.data()[j] );
}

//write scanline to the dataset

0 comments on commit 00e0473

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