diff options
author | Jacques Lucke <jacques@blender.org> | 2022-07-12 17:26:50 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-07-12 17:27:06 +0300 |
commit | d58072caf4abb254d5e5f0e3b9de9bef775f287a (patch) | |
tree | 13a60046e31c007f1d889382620ca27e09eb7ce8 /source/blender/blenkernel/intern/geometry_component_pointcloud.cc | |
parent | 47dd42485e19106601167f6be7b5960c4be25167 (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_pointcloud.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_pointcloud.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc index b439a9ba7f8..ccc97f92dbc 100644 --- a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc +++ b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc @@ -226,8 +226,9 @@ std::optional<blender::bke::AttributeAccessor> PointCloudComponent::attributes() std::optional<blender::bke::MutableAttributeAccessor> PointCloudComponent::attributes_for_write() { + PointCloud *pointcloud = this->get_for_write(); return blender::bke::MutableAttributeAccessor( - pointcloud_, blender::bke::get_pointcloud_accessor_functions_ref()); + pointcloud, blender::bke::get_pointcloud_accessor_functions_ref()); } /** \} */ |