Commit 83efcf77 authored by David Flynn's avatar David Flynn
Browse files

attr/m50745: fix invalid array access in LoD neighbour search

This fixes an issue when during predictor construction, when
lodIndex == levelOfDetailCount causing the retained set to be empty.
parent 3164a977
......@@ -522,10 +522,9 @@ computeNearestNeighbors(
const int32_t pointIndex = packedVoxel[index].index;
const auto& point = pointCloud[pointIndex];
indexes[i] = pointIndex;
while (j < retainedSize
while (j < retainedSize - 1
&& mortonCode >= packedVoxel[retained[j]].mortonCode)
j = std::min(retainedSize - 1, j);
auto& predictor = predictors[--predIndex];
pointIndexToPredictorIndex[pointIndex] = predIndex;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment