Fix: Hang on invalid index in Sample Curve Node #112775

Closed
Henrik D. wants to merge 1 commits from weasel/blender:curve-sample-fix into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 1 deletions

View File

@ -425,7 +425,10 @@ class SampleCurveFunction : public mf::MultiFunction {
IndexMask::from_groups<int>(
mask,
memory,
[&](const int i) { return used_curves.index_of(curve_indices[i]); },
[&](const int i) {
const int64_t group = used_curves.index_of_try(curve_indices[i]);
return group >= 0L ? group : 0L;
},
mask_by_curve);
for (const int i : mask_by_curve.index_range()) {