From 93d6fd05a9f9051b126abc1a47ee1ed75d33515a Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Fri, 16 Jun 2017 12:32:43 +0300 Subject: [PATCH] No timestamps SIGSEV fix --- src/engine/routing_algorithms/map_matching.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/engine/routing_algorithms/map_matching.cpp b/src/engine/routing_algorithms/map_matching.cpp index 2f479116b..c06a2ff44 100644 --- a/src/engine/routing_algorithms/map_matching.cpp +++ b/src/engine/routing_algorithms/map_matching.cpp @@ -145,8 +145,17 @@ SubMatchingList mapMatching(SearchEngineData &engine_working_data, for (auto t = initial_timestamp + 1; t < candidates_list.size(); ++t) { - const auto step_time = - trace_timestamps[t] - trace_timestamps[prev_unbroken_timestamps.back()]; + const auto step_time = [&] { + if (use_timestamps) + { + return trace_timestamps[t] - trace_timestamps[prev_unbroken_timestamps.back()]; + } + else + { + return 1u; + } + }(); + const auto max_distance_delta = [&] { if (use_timestamps) {