[Bf-blender-cvs] [88a2b054dab] master: Fix T91732: crash in Set Position node on empty mesh
Jacques Lucke
noreply at git.blender.org
Sun Sep 26 23:30:42 CEST 2021
Commit: 88a2b054daba747ab2904c19f73c2e2a1bb9617a
Author: Jacques Lucke
Date: Sun Sep 26 23:10:26 2021 +0200
Branches: master
https://developer.blender.org/rB88a2b054daba747ab2904c19f73c2e2a1bb9617a
Fix T91732: crash in Set Position node on empty mesh
===================================================================
M source/blender/functions/intern/field.cc
M source/blender/nodes/geometry/nodes/node_geo_set_position.cc
===================================================================
diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc
index 4f7ea8ec0ef..88e4e5ccd71 100644
--- a/source/blender/functions/intern/field.cc
+++ b/source/blender/functions/intern/field.cc
@@ -450,7 +450,7 @@ Vector<const GVArray *> evaluate_fields(ResourceScope &scope,
type, array_size, buffer);
}
- procedure_executor.call(IndexRange(1), mf_params, mf_context);
+ procedure_executor.call(IndexRange(mask_size), mf_params, mf_context);
}
/* Copy data to supplied destination arrays if necessary. In some cases the evaluation above has
diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc
index be923fdccb0..8caf961fc04 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc
@@ -34,6 +34,9 @@ static void set_position_in_component(GeometryComponent &component,
{
GeometryComponentFieldContext field_context{component, ATTR_DOMAIN_POINT};
const int domain_size = component.attribute_domain_size(ATTR_DOMAIN_POINT);
+ if (domain_size == 0) {
+ return;
+ }
fn::FieldEvaluator selection_evaluator{field_context, domain_size};
selection_evaluator.add(selection_field);
More information about the Bf-blender-cvs
mailing list