Replay: fix SEGFAULT in buildTimeline if segments are not continuous. (#26691)

fix segfault in buildtimeline
This commit is contained in:
Dean Lee
2022-12-05 03:28:40 +08:00
committed by GitHub
parent 7b0bfabb95
commit 0ff703d82f
+2 -2
View File
@@ -123,9 +123,9 @@ void Replay::buildTimeline() {
uint64_t alert_begin = 0;
TimelineType alert_type = TimelineType::None;
for (int i = 0; i < segments_.size() && !exit_; ++i) {
for (auto it = segments_.cbegin(); it != segments_.cend() && !exit_; ++it) {
LogReader log;
if (!log.load(route_->at(i).qlog.toStdString(), &exit_,
if (!log.load(route_->at(it->first).qlog.toStdString(), &exit_,
{cereal::Event::Which::CONTROLS_STATE, cereal::Event::Which::USER_FLAG},
!hasFlag(REPLAY_FLAG_NO_FILE_CACHE), 0, 3)) continue;