diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-18 17:28:04 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-18 17:28:04 +0300 |
commit | b926f54f3c0888ee591516f586a4dec5156fb82a (patch) | |
tree | 90a66e9e19825be8c531345ea761bc2fb1791025 /source/blender/blenkernel | |
parent | f71813204c405821bb2efb8e4ad65d240d390eaf (diff) |
Fix: error when materializing curve point attribute
Differential Revision: https://developer.blender.org/D13271
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curve.cc | 6 |
1 files 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<Span<T>> 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<Span<T>> 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++; } |