From 551cb3c65bdba0386468e3cacba0821128407a3a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 12 Feb 2025 14:06:55 +0100 Subject: [PATCH] Fix (unreported) invalid calloc'ed data in fmodifier_ui. This `panel->runtime->custom_data_ptr` is `MEM_delete`'d even, so that was plainfully wrong allocation code. Will crash in main/4.5 due to PointerRNA now requiring proper C++ construction/destruction. --- source/blender/editors/animation/fmodifier_ui.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/blender/editors/animation/fmodifier_ui.cc b/source/blender/editors/animation/fmodifier_ui.cc index e49db50ceef..9141e2a229a 100644 --- a/source/blender/editors/animation/fmodifier_ui.cc +++ b/source/blender/editors/animation/fmodifier_ui.cc @@ -889,8 +889,7 @@ void ANIM_fmodifier_panels(const bContext *C, char panel_idname[MAX_NAME]; panel_id_fn(fcm, panel_idname); - PointerRNA *fcm_ptr = static_cast( - MEM_mallocN(sizeof(PointerRNA), "panel customdata")); + PointerRNA *fcm_ptr = MEM_new("panel customdata"); *fcm_ptr = RNA_pointer_create_discrete(owner_id, &RNA_FModifier, fcm); UI_panel_add_instanced(C, region, ®ion->panels, panel_idname, fcm_ptr);