From 6e926e9b567eb51124b5ca92099fb1424676e77f Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 14 Jan 2022 16:10:38 -0600 Subject: Fix T94852: Geometry Proximity crash when unsuccessful Before rB644e6c7a3e99ae1d43ed, `fill` was used in the error cases, but now `fill_indices` is used, which doesn't work when the span is empty (when only one output is used). The fix is just to check for that case. --- source/blender/nodes/geometry/nodes/node_geo_proximity.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc index 772638ef240..3f509942f7c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc @@ -191,8 +191,12 @@ class ProximityFunction : public fn::MultiFunction { } if (!success) { - positions.fill_indices(mask, float3(0)); - distances.fill_indices(mask, 0.0f); + if (!positions.is_empty()) { + positions.fill_indices(mask, float3(0)); + } + if (!distances.is_empty()) { + distances.fill_indices(mask, 0.0f); + } return; } -- cgit v1.2.3