Merge pull request #49142 from Chaosus/bvh_fix_possible_crash
Fixed possible crash in `DynamicBVH::optimize_incremental`
This commit is contained in:
commit
5ec8920cde
1 changed files with 4 additions and 1 deletions
|
@ -312,8 +312,11 @@ void DynamicBVH::optimize_incremental(int passes) {
|
|||
if (passes < 0) {
|
||||
passes = total_leaves;
|
||||
}
|
||||
if (bvh_root && (passes > 0)) {
|
||||
if (passes > 0) {
|
||||
do {
|
||||
if (!bvh_root) {
|
||||
break;
|
||||
}
|
||||
Node *node = bvh_root;
|
||||
unsigned bit = 0;
|
||||
while (node->is_internal()) {
|
||||
|
|
Loading…
Reference in a new issue