Skip to content

Commit

Permalink
fix(intersection): fix possible invalid access (autowarefoundation#6542)
Browse files Browse the repository at this point in the history
Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin authored and shmpwk committed Mar 5, 2024
1 parent d9c5e3d commit de648b8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ lanelet::LineString3d getLineStringFromArcLength(
lanelet::Points3d points;
double accumulated_length = 0;
size_t start_index = linestring.size();
if (start_index == 0) {
return lanelet::LineString3d{lanelet::InvalId, points};
}
for (size_t i = 0; i < linestring.size() - 1; i++) {
const auto & p1 = linestring[i];
const auto & p2 = linestring[i + 1];
Expand Down

0 comments on commit de648b8

Please sign in to comment.