Fix T98400: Duplicate node crash

This commit is contained in:
Johnny Matthews 2022-05-29 14:19:05 -05:00
parent 49368c734b
commit 32bf6455a0
Notes: blender-bot 2023-02-14 06:49:54 +01:00
Referenced by issue #98522, Regression: Geometry Nodes - Setting curve_type, nurbs_order and knots_mode through Named Attributes is broken in latest 3.2/3.3 builds
Referenced by issue #98400, Geometry Nodes: Crash with Duplicate Elements and Set ID
1 changed files with 3 additions and 0 deletions

View File

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