Skip to content
Permalink
Browse files

Natural Breaks (Jenks) classification causes crash (#42618)

  • Loading branch information
tomass authored and nyalldawson committed Apr 7, 2021
1 parent 2d4f73d commit d2dff9b5cd5defcbc633ae6f0ff3741c5c8163fc
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/classification/qgsclassificationjenks.cpp
@@ -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 ];
}
}

0 comments on commit d2dff9b

Please sign in to comment.