1
1

Fix T99661: Use after free converting edit mode curve object to mesh

The fix from c0fdf16561 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.
This commit is contained in:
2022-08-09 17:49:41 -05:00
parent 79f1cc601c
commit 31e06a8c73

View File

@@ -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);
}