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:
authorHans Goudey <h.goudey@me.com>2022-08-10 01:49:41 +0300
committerHans Goudey <h.goudey@me.com>2022-08-10 02:24:44 +0300
commit31e06a8c73b3c43d339e60ccbbc7f7d14c8d5221 (patch)
tree64eaa44d84581bc35cd6c70adbd8b2c9ea3987bc /source/blender
parent79f1cc601cdbcf142e1bf4c1966f64dcf93b030f (diff)
Fix T99661: Use after free converting edit mode curve object to mesh
The fix from c0fdf16561034f85aadae8a was missing in one place. We don't want to free the edit mode pointers, those are just copied because the edit mode changes aren't present in the actual original data-block.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_convert.cc b/source/blender/blenkernel/intern/mesh_convert.cc
index 923d2703960..81bab9f796f 100644
--- a/source/blender/blenkernel/intern/mesh_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_convert.cc
@@ -985,6 +985,12 @@ static Mesh *mesh_new_from_curve_type_object(const Object *object)
/* If evaluating the curve replaced object data with different data, free the original data. */
if (temp_data != temp_object->data) {
+ if (GS(temp_data->name) == ID_CU_LEGACY) {
+ /* Clear edit mode pointers that were explicitly copied to the temporary curve. */
+ Curve *curve = reinterpret_cast<Curve *>(temp_data);
+ curve->editfont = nullptr;
+ curve->editnurb = nullptr;
+ }
BKE_id_free(nullptr, temp_data);
}