Skip to content

Commit 8ffbc44

Browse files
authored
fix: Segfault in UnresolvedManeuverOverride::Turns() on Australia extracts (#7112)
1 parent d8680a0 commit 8ffbc44

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
- FIXED: Ensure required file check in osrm-routed is correctly enforced. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
8080
- FIXED: Correct HTTP docs to reflect summary output dependency on steps parameter. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655)
8181
- ADDED: Extract prerelease/build information from package semver [#6839](https://github.com/Project-OSRM/osrm-backend/pull/6839)
82+
- FIXED: Segfault in `UnresolvedManeuverOverride::Turns()` on Australia extracts [#7112](https://github.com/Project-OSRM/osrm-backend/pull/7112)
8283
- CHANGED: Replaced PL:trunk with PL:expressway to match the latest changes in Polish tagging [#7079](https://github.com/Project-OSRM/osrm-backend/pull/7079)
8384
- Profiles:
8485
- FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615)

src/extractor/turn_path_filter.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ std::vector<T> removeInvalidTurnPaths(std::vector<T> turn_relations,
4242
is_valid_edge(via_node_path.via, via_node_path.to);
4343
};
4444

45-
const auto is_valid_way = [is_valid_edge](const auto &via_way_path)
45+
const auto is_valid_way = [is_valid_edge](const ViaWayPath &via_way_path)
4646
{
47+
if (!via_way_path.Valid())
48+
return false;
49+
4750
if (!is_valid_edge(via_way_path.from, via_way_path.via.front()))
4851
return false;
4952

@@ -59,13 +62,16 @@ std::vector<T> removeInvalidTurnPaths(std::vector<T> turn_relations,
5962

6063
const auto is_invalid = [is_valid_way, is_valid_node](const auto &turn_relation)
6164
{
62-
if (turn_relation.turn_path.Type() == TurnPathType::VIA_NODE_TURN_PATH)
65+
switch (turn_relation.turn_path.Type())
6366
{
67+
case TurnPathType::VIA_NODE_TURN_PATH:
6468
return !is_valid_node(turn_relation.turn_path.AsViaNodePath());
69+
case TurnPathType::VIA_WAY_TURN_PATH:
70+
return !is_valid_way(turn_relation.turn_path.AsViaWayPath());
71+
default:
72+
break;
6573
}
66-
67-
BOOST_ASSERT(turn_relation.turn_path.Type() == TurnPathType::VIA_WAY_TURN_PATH);
68-
return !is_valid_way(turn_relation.turn_path.AsViaWayPath());
74+
return true;
6975
};
7076

7177
const auto end_valid_relations =

0 commit comments

Comments
 (0)