From b926f54f3c0888ee591516f586a4dec5156fb82a Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 18 Nov 2021 15:28:04 +0100 Subject: Fix: error when materializing curve point attribute Differential Revision: https://developer.blender.org/D13271 --- source/blender/blenkernel/intern/geometry_component_curve.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index d3c3fcc1e67..961265f3a16 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -563,7 +563,8 @@ static void point_attribute_materialize(Span> data, else { int spline_index = 0; for (const int dst_index : mask) { - while (offsets[spline_index] < dst_index) { + /* Skip splines that don't have any control points in the mask. */ + while (dst_index >= offsets[spline_index + 1]) { spline_index++; } @@ -607,7 +608,8 @@ static void point_attribute_materialize_to_uninitialized(Span> data, else { int spline_index = 0; for (const int dst_index : mask) { - while (offsets[spline_index] < dst_index) { + /* Skip splines that don't have any control points in the mask. */ + while (dst_index >= offsets[spline_index + 1]) { spline_index++; } -- cgit v1.2.3