From 57f35337e9be321305d368a7d8fdbacbab7a62b0 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 3 Sep 2025 16:57:58 +0200 Subject: [PATCH] Fix #145666: Crash separating all curves The offsets array is empty when there are no curves, even though its size is usually one more than the number of curves. Pull Request: https://projects.blender.org/blender/blender/pulls/145669 --- source/blender/editors/curves/intern/curves_edit.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/curves/intern/curves_edit.cc b/source/blender/editors/curves/intern/curves_edit.cc index 9dfe1974dca..21eeb210fea 100644 --- a/source/blender/editors/curves/intern/curves_edit.cc +++ b/source/blender/editors/curves/intern/curves_edit.cc @@ -380,7 +380,9 @@ static bke::CurvesGeometry copy_data_to_geometry(const bke::CurvesGeometry &src_ bke::CurvesGeometry dst_curves(offsets.last(), dst_to_src_curve.size()); BKE_defgroup_copy_list(&dst_curves.vertex_group_names, &src_curves.vertex_group_names); - array_utils::copy(offsets, dst_curves.offsets_for_write()); + if (!dst_curves.is_empty()) { + array_utils::copy(offsets, dst_curves.offsets_for_write()); + } dst_curves.cyclic_for_write().copy_from(cyclic); const bke::AttributeAccessor src_attributes = src_curves.attributes();