Skip to content

Commit

Permalink
Natural Breaks (Jenks) classification causes crash (#42618)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomass authored and nyalldawson committed Apr 7, 2021
1 parent 2d4f73d commit d2dff9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/classification/qgsclassificationjenks.cpp
Expand Up @@ -99,10 +99,11 @@ QList<double> QgsClassificationJenks::calculateBreaks( double &minimum, double &

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
double r = QRandomGenerator::global()->generate();
int j = std::floor( r / QRandomGenerator::max() * ( values.size() - 1 ) );
#else
double r = qrand();
#endif
int j = std::floor( r / RAND_MAX * ( values.size() - 1 ) );
#endif
sample[ i ] = values[ j ];
}
}
Expand Down

0 comments on commit d2dff9b

Please sign in to comment.