From 4e873487dcac451ec840aca137f1dcb43b659dee Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 5 Feb 2025 08:57:40 -0500 Subject: [PATCH] Fix: Potential crash in curves attribute set operator Similar to #134108. Caused by 0089a90625dd425803e8921a6573e17719b4bf9f.. --- source/blender/editors/curves/intern/curves_attribute_set.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/curves/intern/curves_attribute_set.cc b/source/blender/editors/curves/intern/curves_attribute_set.cc index a94f9cff68f..b1c00b93c6a 100644 --- a/source/blender/editors/curves/intern/curves_attribute_set.cc +++ b/source/blender/editors/curves/intern/curves_attribute_set.cc @@ -93,8 +93,8 @@ static int set_attribute_exec(bContext *C, wmOperator *op) Object *active_object = CTX_data_active_object(C); Curves &active_curves_id = *static_cast(active_object->data); - AttributeOwner owner = AttributeOwner::from_id(&active_curves_id.id); - CustomDataLayer *active_attribute = BKE_attributes_active_get(owner); + AttributeOwner active_owner = AttributeOwner::from_id(&active_curves_id.id); + CustomDataLayer *active_attribute = BKE_attributes_active_get(active_owner); const eCustomDataType active_type = eCustomDataType(active_attribute->type); const CPPType &type = *bke::custom_data_type_to_cpp_type(active_type); @@ -107,6 +107,7 @@ static int set_attribute_exec(bContext *C, wmOperator *op) for (Curves *curves_id : get_unique_editable_curves(*C)) { bke::CurvesGeometry &curves = curves_id->geometry.wrap(); + AttributeOwner owner = AttributeOwner::from_id(&curves_id->id); CustomDataLayer *layer = BKE_attributes_active_get(owner); if (!layer) { continue;