Merge pull request #25493 from bojidar-bg/21601-astar-segfault

Fix AStar crashing with large (>1e30) estimated values
This commit is contained in:
Rémi Verschelde 2019-01-31 10:32:22 +01:00 committed by GitHub
commit 6225b17d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,8 +260,8 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
}
// Check open list
SelfList<Point> *least_cost_point = NULL;
real_t least_cost = 1e30;
SelfList<Point> *least_cost_point = open_list.first();
real_t least_cost = Math_INF;
// TODO: Cache previous results
for (SelfList<Point> *E = open_list.first(); E; E = E->next()) {