diff --git a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp index e184731c4ff67..a8c4cda9c0327 100644 --- a/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp +++ b/planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp @@ -1282,7 +1282,9 @@ std::vector get_preceding_lanes(const CommonDataPtr & co continue; } - lanelet::ConstLanelets non_overlapping_lanes(lanes_reversed.begin(), overlapped_itr); + // Lanes are not reversed by default. Avoid returning reversed lanes to prevent undefined + // behavior. + lanelet::ConstLanelets non_overlapping_lanes(overlapped_itr.base(), lanes.end()); non_overlapping_lanes_vec.push_back(non_overlapping_lanes); }