Fix #26203: crash with empty raytree, all types should survive this now.

Also added a check for -inf/inf bounding boxes, just to be sure.
This commit is contained in:
Brecht Van Lommel
2011-03-11 22:27:06 +00:00
parent 60a4c9d09e
commit 9dfda4b002
6 changed files with 37 additions and 15 deletions

View File

@@ -98,13 +98,17 @@ void bvh_done<VBVHTree>(VBVHTree *obj)
return;
}
reorganize(root);
remove_useless(root, &root);
bvh_refit(root);
pushup(root);
pushdown(root);
obj->root = root;
if(root) {
reorganize(root);
remove_useless(root, &root);
bvh_refit(root);
pushup(root);
pushdown(root);
obj->root = root;
}
else
obj->root = NULL;
}
else
{