mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix SEGV in W'bal ridefilecache
.. when computing the distribution due to problems casting double to int for nan/inf values.
This commit is contained in:
@@ -1353,12 +1353,12 @@ RideFileCache::computeDistribution(QVector<float> &array, RideFile::SeriesType s
|
||||
foreach(int value, ride->wprimeData()->ydata()) {
|
||||
|
||||
// percent is PERCENT OF W' USED
|
||||
double percent = 100.0f - ((double (value) / WPRIME) * 100.0f);
|
||||
int percent = 100.0f - ((double (value) / WPRIME) * 100.0f);
|
||||
if (percent < 0.0f) percent = 0.0f;
|
||||
if (percent > 100.0f) percent = 100.0f;
|
||||
|
||||
// increment counts
|
||||
array[(int)percent]++;
|
||||
array[percent]++;
|
||||
count++;
|
||||
|
||||
// and zones in 1s increments
|
||||
|
||||
Reference in New Issue
Block a user