From de648b82016623d6004d807094b729a78cb42e8f Mon Sep 17 00:00:00 2001 From: Mamoru Sobue Date: Tue, 5 Mar 2024 15:36:16 +0900 Subject: [PATCH] fix(intersection): fix possible invalid access (#6542) Signed-off-by: Mamoru Sobue --- .../src/scene_intersection_stuck.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/planning/behavior_velocity_intersection_module/src/scene_intersection_stuck.cpp b/planning/behavior_velocity_intersection_module/src/scene_intersection_stuck.cpp index a52c96567e928..6c9254919cac7 100644 --- a/planning/behavior_velocity_intersection_module/src/scene_intersection_stuck.cpp +++ b/planning/behavior_velocity_intersection_module/src/scene_intersection_stuck.cpp @@ -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];