Skip to content

Commit 1fe1a99

Browse files
committed
Fix crash in relief calculation when exporting distribution to csv
Fixes #19570 (cherry-picked from c860696)
1 parent a47682f commit 1fe1a99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/analysis/raster/qgsrelief.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString &file )
522522
for ( int j = 0; j < nCellsX; ++j )
523523
{
524524
elevationClass = frequencyClassForElevation( scanLine[j], minMax[0], frequencyClassRange );
525-
if ( elevationClass >= 0 )
525+
if ( elevationClass >= 0 && elevationClass < 252 )
526526
{
527527
frequency[elevationClass] += 1.0;
528528
}

0 commit comments

Comments
 (0)