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 01:49:41 +0300
commit90b7c3d05e58543650c4831bbc1f3765b526673b (patch)
tree1cd16baf968cc682c8319bbae79f87f4634d78ad /source/blender/blenkernel/intern/mesh_convert.cc
parenta9a7460570958c0741f4222497805db45d6db5bc (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/blenkernel/intern/mesh_convert.cc')
-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);
}