Fix integer underflow in Index Points node (#3623)

Fix: Prevent integer underflow in Index Points node
This commit is contained in:
Kulcode
2026-01-12 05:21:55 +05:30
committed by GitHub
parent 5dd11bf138
commit 479688d86b

View File

@@ -2275,6 +2275,9 @@ async fn index_points(
) -> DVec2 {
let points_count = content.iter().map(|row| row.element.point_domain.positions().len()).sum::<usize>();
if points_count == 0 {
return DVec2::ZERO;
}
// Clamp and allow negative indexing from the end
let index = index as isize;
let index = if index < 0 {