[traffxml] Fix segfault when deleting the last vector element

v.erase(v.end()) is incorrect and will crash on clang but works on gcc

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-07-26 16:58:40 +03:00
parent 06f63dcb9a
commit 958be3dee6

View File

@@ -779,7 +779,7 @@ void RoutingTraffDecoder::DecodeLocationDirection(traffxml::TraffMessage & messa
while(!rsegments.empty() && rsegments.front().GetSegment().GetMwmId() == routing::kFakeNumMwmId)
rsegments.erase(rsegments.begin());
while(!rsegments.empty() && rsegments.back().GetSegment().GetMwmId() == routing::kFakeNumMwmId)
rsegments.erase(rsegments.end());
rsegments.pop_back();
if (!backwards && message.m_location.value().m_at && !message.m_location.value().m_to)
// fromat in forward direction, add last segment