1
0
Fork 0

Fix: don't use INVALID_DATAPOINT for a valid value

pull/11913/head
Patric Stout 2024-01-28 20:51:43 +01:00
parent ccaa383e85
commit f9dacd6e0c
1 changed files with 7 additions and 1 deletions

View File

@ -615,7 +615,13 @@ public:
if (c != nullptr) {
this->colours[numd] = _colour_gradient[c->colour][6];
for (int j = this->num_on_x_axis, i = 0; --j >= 0;) {
this->cost[numd][i] = (j >= c->num_valid_stat_ent) ? INVALID_DATAPOINT : GetGraphData(c, j);
if (j >= c->num_valid_stat_ent) {
this->cost[numd][i] = INVALID_DATAPOINT;
} else {
/* Ensure we never assign INVALID_DATAPOINT, as that has another meaning.
* Instead, use the value just under it. Hopefully nobody will notice. */
this->cost[numd][i] = std::min(GetGraphData(c, j), INVALID_DATAPOINT - 1);
}
i++;
}
}