[Bf-blender-cvs] [6e926e9b567] master: Fix T94852: Geometry Proximity crash when unsuccessful

Hans Goudey noreply at git.blender.org
Fri Jan 14 23:10:49 CET 2022


Commit: 6e926e9b567eb51124b5ca92099fb1424676e77f
Author: Hans Goudey
Date:   Fri Jan 14 16:10:38 2022 -0600
Branches: master
https://developer.blender.org/rB6e926e9b567eb51124b5ca92099fb1424676e77f

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.

===================================================================

M	source/blender/nodes/geometry/nodes/node_geo_proximity.cc

===================================================================

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;
     }



More information about the Bf-blender-cvs mailing list