Merge pull request #49142 from Chaosus/bvh_fix_possible_crash

Fixed possible crash in `DynamicBVH::optimize_incremental`
This commit is contained in:
Rémi Verschelde 2021-05-31 21:04:08 +02:00 committed by GitHub
commit 5ec8920cde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()) {