Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-11-18 17:28:04 +0300
committerJacques Lucke <jacques@blender.org>2021-11-18 17:28:04 +0300
commitb926f54f3c0888ee591516f586a4dec5156fb82a (patch)
tree90a66e9e19825be8c531345ea761bc2fb1791025
parentf71813204c405821bb2efb8e4ad65d240d390eaf (diff)
Fix: error when materializing curve point attribute
Differential Revision: https://developer.blender.org/D13271
-rw-r--r--source/blender/blenkernel/intern/geometry_component_curve.cc6
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++;
}