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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

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