[Bf-blender-cvs] [cc4b6c64764] master: Fix T98400: Duplicate node crash

Johnny Matthews noreply at git.blender.org
Sun May 29 21:26:03 CEST 2022


Commit: cc4b6c64764e2716558a6abb3fa912742ac3f00e
Author: Johnny Matthews
Date:   Sun May 29 14:19:05 2022 -0500
Branches: master
https://developer.blender.org/rBcc4b6c64764e2716558a6abb3fa912742ac3f00e

Fix T98400: Duplicate node crash

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

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

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
index 90837486186..ac057ad078b 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
@@ -128,6 +128,9 @@ static void threaded_id_offset_copy(const Span<int> offsets,
     for (const int i : range) {
       dst[offsets[i]] = src[i];
       const int count = offsets[i + 1] - offsets[i];
+      if (count == 0) {
+        continue;
+      }
       for (const int i_duplicate : IndexRange(1, count - 1)) {
         dst[offsets[i] + i_duplicate] = noise::hash(src[i], i_duplicate);
       }



More information about the Bf-blender-cvs mailing list