From fa0ac99dfa964337590c86c435bc893ceed5e5b0 Mon Sep 17 00:00:00 2001 From: deanlee Date: Wed, 29 Sep 2021 03:09:43 +0800 Subject: [PATCH] check framereader!=null --- selfdrive/ui/replay/logreader.cc | 2 +- selfdrive/ui/replay/replay.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/replay/logreader.cc b/selfdrive/ui/replay/logreader.cc index 4dad9f71e02ed9..25f3b399c790e6 100644 --- a/selfdrive/ui/replay/logreader.cc +++ b/selfdrive/ui/replay/logreader.cc @@ -77,7 +77,7 @@ bool LogReader::load(const std::string &file) { } } - // insert custom eidx events for publish frames. + // insert custom EncodeIdx events for publish frames. for (auto cam : ALL_CAMERAS) { for (auto [frame_id, val] : eidx_map[cam]) { auto [e, eidx] = val; diff --git a/selfdrive/ui/replay/replay.cc b/selfdrive/ui/replay/replay.cc index 699457db9d66fe..a153edb86fd816 100644 --- a/selfdrive/ui/replay/replay.cc +++ b/selfdrive/ui/replay/replay.cc @@ -221,7 +221,7 @@ void Replay::stream() { if (evt->which == cereal::Event::ROAD_ENCODE_IDX) { auto idx = evt->event.getRoadEncodeIdx(); auto &seg = segments_[idx.getSegmentNum()]; - if (seg && seg->isLoaded()) { + if (seg && seg->isLoaded() && seg->frames[RoadCam]) { auto &frm = seg->frames[RoadCam]; if (vipc_server == nullptr) { cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT);