Skip to content

Commit

Permalink
[rastercalc] Fix use of uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 15, 2015
1 parent 93649bc commit 00e0473
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/analysis/raster/qgsrastercalculator.cpp
Expand Up @@ -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 )
Expand All @@ -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
Expand Down

0 comments on commit 00e0473

Please sign in to comment.