From f2c40ca9f01d44871b055afdcd0434b2a8309927 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Mar 2016 21:50:54 +1100 Subject: Fix uninitialized memory use lattice-boundbox Many other places weren't clearing boundbox dirty flag after calculation. --- source/blender/blenkernel/intern/lattice.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/lattice.c') diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 1992eabafec..57c02ec6329 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -1152,8 +1152,9 @@ static void boundbox_lattice(Object *ob) Lattice *lt; float min[3], max[3]; - if (ob->bb == NULL) - ob->bb = MEM_mallocN(sizeof(BoundBox), "Lattice boundbox"); + if (ob->bb == NULL) { + ob->bb = MEM_callocN(sizeof(BoundBox), "Lattice boundbox"); + } bb = ob->bb; lt = ob->data; @@ -1161,6 +1162,8 @@ static void boundbox_lattice(Object *ob) INIT_MINMAX(min, max); BKE_lattice_minmax_dl(ob, lt, min, max); BKE_boundbox_init_from_minmax(bb, min, max); + + bb->flag &= ~BOUNDBOX_DIRTY; } BoundBox *BKE_lattice_boundbox_get(Object *ob) -- cgit v1.2.3