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>2022-07-12 17:26:50 +0300
committerJacques Lucke <jacques@blender.org>2022-07-12 17:27:06 +0300
commitd58072caf4abb254d5e5f0e3b9de9bef775f287a (patch)
tree13a60046e31c007f1d889382620ca27e09eb7ce8 /source/blender/blenkernel/intern/geometry_component_curves.cc
parent47dd42485e19106601167f6be7b5960c4be25167 (diff)
Fix: missing geometry copy before modifying it
A geometry component may reference read-only geometry. In this case it has to be copied before making changes to it. This was caused by rBb876ce2a4a4638142.
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curves.cc')
-rw-r--r--source/blender/blenkernel/intern/geometry_component_curves.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curves.cc b/source/blender/blenkernel/intern/geometry_component_curves.cc
index 34c17bedc2c..f803b08e740 100644
--- a/source/blender/blenkernel/intern/geometry_component_curves.cc
+++ b/source/blender/blenkernel/intern/geometry_component_curves.cc
@@ -644,6 +644,7 @@ std::optional<blender::bke::AttributeAccessor> CurveComponent::attributes() cons
std::optional<blender::bke::MutableAttributeAccessor> CurveComponent::attributes_for_write()
{
- return blender::bke::MutableAttributeAccessor(curves_ ? &curves_->geometry : nullptr,
+ Curves *curves = this->get_for_write();
+ return blender::bke::MutableAttributeAccessor(curves ? &curves->geometry : nullptr,
blender::bke::get_curves_accessor_functions_ref());
}