diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-05 02:42:01 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-05 02:42:01 +0300 |
commit | 1d86d617823b7aadaf40d6d80f1c694a1c2b9521 (patch) | |
tree | a0af0ef64aa1a84f15bdd57b02fe2fd9aa0ce391 /source | |
parent | 43a582a2abff46c295711a88349a9222e12b89a6 (diff) |
Fix: Assert fails when evaluating single point Bezier curve
Return early when there is only one point,
since that means there are no segments.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/curve_bezier.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curve_bezier.cc b/source/blender/blenkernel/intern/curve_bezier.cc index 30a5869c976..dfe462d8566 100644 --- a/source/blender/blenkernel/intern/curve_bezier.cc +++ b/source/blender/blenkernel/intern/curve_bezier.cc @@ -218,6 +218,10 @@ void calculate_evaluated_positions(const Span<float3> positions, { BLI_assert(evaluated_offsets.last() == evaluated_positions.size()); BLI_assert(evaluated_offsets.size() == positions.size()); + if (evaluated_offsets.last() == 1) { + evaluated_positions.first() = positions.first(); + return; + } /* Evaluate the first segment. */ evaluate_segment(positions.first(), |