DRW: Fix crash when object has no bounding box

This commit is contained in:
Clément Foucault 2019-05-30 19:33:48 +02:00
parent 8f4b7083d3
commit 493eaaf213
1 changed files with 2 additions and 2 deletions

View File

@ -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]);