mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
added guard to protect against external child access
This commit is contained in:
parent
dcccfb7ef0
commit
b8a87294e6
1 changed files with 6 additions and 1 deletions
|
@ -409,7 +409,12 @@ VoxelNode* VoxelNode::getChildAtIndex(int childIndex) const {
|
|||
for (int ordinal = 1; ordinal <= childCount; ordinal++) {
|
||||
int index = getNthBit(_childBitmask, ordinal);
|
||||
if (index == childIndex) {
|
||||
result = _children.external[ordinal-1];
|
||||
int externalIndex = ordinal-1;
|
||||
if (externalIndex < childCount && externalIndex >= 0) {
|
||||
result = _children.external[externalIndex];
|
||||
} else {
|
||||
qDebug("getChildAtIndex() attempt to access external client out of bounds externalIndex=%d <<<<<<<<<< WARNING!!! \n",externalIndex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue