Skip to content

Commit

Permalink
Fix crash in relief calculation when exporting distribution to csv
Browse files Browse the repository at this point in the history
Fixes #19570
  • Loading branch information
nyalldawson committed Aug 9, 2018
1 parent 4c9a23e commit c860696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/analysis/raster/qgsrelief.cpp
Expand Up @@ -522,7 +522,7 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString &file )
for ( int j = 0; j < nCellsX; ++j )
{
elevationClass = frequencyClassForElevation( scanLine[j], minMax[0], frequencyClassRange );
if ( elevationClass >= 0 )
if ( elevationClass >= 0 && elevationClass < 252 )
{
frequency[elevationClass] += 1.0;
}
Expand Down

0 comments on commit c860696

Please sign in to comment.