-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
CrashA panic which crashed the editorA panic which crashed the editorGood First IssueGood for newcomersGood for newcomers
Description
Reproduce
- New document
- Open node graph
- Create «Path node»
- Connect output to «Index Points»
- Connect output to the «Line» node (you must expose one of the inputs to the node graph by clicking on the circle)
- Connect output to graph output
Reproduction file: index_points_underflow.graphite.json (file -> open then remove any file extension filtering to see it)
Cause
The crash only occurs in debug mode:
frontend/wasm/src/lib.rs:45
Node graph evaluation panicked panicked at node-graph/nodes/vector/src/vector_nodes.rs:2283:30:
attempt to subtract with overflow
If index is >= 0 (as is default) and points_count is 0 then there is underflow
Graphite/node-graph/nodes/vector/src/vector_nodes.rs
Lines 2276 to 2284 in 1b91198
| let points_count = content.iter().map(|row| row.element.point_domain.positions().len()).sum::<usize>(); | |
| // Clamp and allow negative indexing from the end | |
| let index = index as isize; | |
| let index = if index < 0 { | |
| (points_count as isize + index).max(0) as usize | |
| } else { | |
| (index as usize).min(points_count - 1) | |
| }; |
Metadata
Metadata
Assignees
Labels
CrashA panic which crashed the editorA panic which crashed the editorGood First IssueGood for newcomersGood for newcomers
Type
Projects
Status
Short-Term