[Bf-blender-cvs] [493eaaf213d] master: DRW: Fix crash when object has no bounding box

Clément Foucault noreply at git.blender.org
Thu May 30 19:35:44 CEST 2019


Commit: 493eaaf213dac66cb22b2c1c0b5400295afee6c3
Author: Clément Foucault
Date:   Thu May 30 19:33:48 2019 +0200
Branches: master
https://developer.blender.org/rB493eaaf213dac66cb22b2c1c0b5400295afee6c3

DRW: Fix crash when object has no bounding box

===================================================================

M	source/blender/draw/intern/draw_manager_data.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 7ac7fdf1ff2..27d4194db5c 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -407,9 +407,9 @@ static DRWCallState *drw_call_state_create(DRWShadingGroup *shgroup, float (*obm
   DRWCullingState *cull = BLI_memblock_alloc(DST.vmempool->cullstates);
   state->culling = cull;
 
-  if (ob != NULL) {
+  BoundBox *bbox;
+  if (ob != NULL && (bbox = BKE_object_boundbox_get(ob))) {
     float corner[3];
-    BoundBox *bbox = BKE_object_boundbox_get(ob);
     /* Get BoundSphere center and radius from the BoundBox. */
     mid_v3_v3v3(cull->bsphere.center, bbox->vec[0], bbox->vec[6]);
     mul_v3_m4v3(corner, obmat, bbox->vec[0]);



More information about the Bf-blender-cvs mailing list