Skip to content

Commit

Permalink
Expand index overrun protection to non-dithering ops
Browse files Browse the repository at this point in the history
  • Loading branch information
bwdev01 committed Dec 3, 2024
1 parent 4ddcbe9 commit 887c231
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,11 @@ Eigen::MatrixXd GaussianProcessGuider::regularize_dataset(const Eigen::VectorXd&
{
while (timestamps(i) >= last_cell_end + grid_interval)
{
if (dithering_active_)
if (j >= reg_timestamps.size())
{
GPDebug->Log("PPDbg: Index-over-run in regularize_dataset, j = %d", j);
throw std::runtime_error("Index over-run in regularize_dataset");
}
if (j >= reg_timestamps.size())
{
GPDebug->Log("PPDbg: Index-over-run in regularize_dataset, j = %d", j);
throw std::runtime_error("Index over-run in regularize_dataset");
}
double inter_timestamp = last_cell_end + grid_interval;

double proportion = (inter_timestamp - last_timestamp) / (timestamps(i) - last_timestamp);
Expand Down

0 comments on commit 887c231

Please sign in to comment.