Skip to content

Commit ccfd27c

Browse files
authored
Merge pull request #1731 from Idclip/ubsan_fix
Fixed an instance of undefined behaviour in tools::activate
2 parents 41bb127 + 669fbab commit ccfd27c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

openvdb/openvdb/tools/Activate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ struct ActivateOp
8787
// only iterate if there are inactive tiles
8888
if (!node.isValueMaskOn()) {
8989
for (auto it = node.beginValueOff(); it; ++it) {
90+
// Skip child nodes, they'll be processed separately
91+
// (InteralNode ValueOff iterators don't automatically
92+
// skip these).
93+
if (node.isChildMaskOn(it.pos())) continue;
9094
if (check(*it)) it.setValueOn(/*on=*/true);
9195
}
9296
}

pendingchanges/ubsan.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
OpenVDB:
2+
- Bug Fixes::
3+
- Fixed an occurance of undefined behaviour in tools::activate (though this would typically not have manifested with any unintended behaviour)

0 commit comments

Comments
 (0)