diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-15 01:10:38 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-15 01:10:38 +0300 |
commit | 6e926e9b567eb51124b5ca92099fb1424676e77f (patch) | |
tree | bbf723c38afc75ce58a797f466efac6c9ffa6b38 /source/blender/nodes | |
parent | 2a095d8bfee39cb6f7f4f108d7febf9780bb8241 (diff) |
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.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_proximity.cc | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |