ui/update_line_data: fix assert when max_idx = TRAJECTORY_SIZE-1 (#21543)

old-commit-hash: f554dc0ae6
commatwo_master
Dean Lee 4 years ago committed by GitHub
parent 6e5af4de8a
commit c351c71641
  1. 2
      selfdrive/ui/ui.cc

@ -85,7 +85,7 @@ static void update_line_data(const UIState *s, const cereal::ModelDataV2::XYZTDa
v += calib_frame_to_full_frame(s, line_x[i], line_y[i] + y_off, line_z[i] + z_off, v); v += calib_frame_to_full_frame(s, line_x[i], line_y[i] + y_off, line_z[i] + z_off, v);
} }
pvd->cnt = v - pvd->v; pvd->cnt = v - pvd->v;
assert(pvd->cnt < std::size(pvd->v)); assert(pvd->cnt <= std::size(pvd->v));
} }
static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) { static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) {

Loading…
Cancel
Save