diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-04 13:50:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-04 13:50:54 +0300 |
commit | f2c40ca9f01d44871b055afdcd0434b2a8309927 (patch) | |
tree | 9349b54b9c402fbda7d8ea1432ea9cefbd7c9bd2 /source/blender/blenkernel/intern/lattice.c | |
parent | b8417501abefa3332254564078ac7b93b875d7b8 (diff) |
Fix uninitialized memory use lattice-boundbox
Many other places weren't clearing boundbox dirty flag after calculation.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) |