From 187c696caee13aaa27ecd03a9c17a0d2af28a938 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 24 Jun 2019 16:29:37 +0200 Subject: Fix T66030: [CRASH] Modifying Normals with Skin Modifier. clnor editing code was simply not checking at all whether it has something to work on... Guess nobody had idea to edit custom normals on a mesh that has no normals before! :P This should probably be handled in a poll function too, to completely disable those tools when there are no faces/loops, but let's keep it to minimal changes at that point. --- source/blender/bmesh/intern/bmesh_mesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/bmesh/intern/bmesh_mesh.c') diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 09a39c05565..c796bdea688 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1582,7 +1582,7 @@ BMLoopNorEditDataArray *BM_loop_normal_editdata_array_init(BMesh *bm, BLI_assert(bm->spacearr_dirty == 0); - BMLoopNorEditDataArray *lnors_ed_arr = MEM_mallocN(sizeof(*lnors_ed_arr), __func__); + BMLoopNorEditDataArray *lnors_ed_arr = MEM_callocN(sizeof(*lnors_ed_arr), __func__); lnors_ed_arr->lidx_to_lnor_editdata = MEM_callocN( sizeof(*lnors_ed_arr->lidx_to_lnor_editdata) * bm->totloop, __func__); -- cgit v1.2.3