BucketBox: fixed possibility of writing one past the end of the given array
This commit is contained in:
committed by
Stuart Buchanan
parent
5d5f1779c6
commit
6ae7eb31a6
@@ -286,16 +286,16 @@ public:
|
||||
continue;
|
||||
|
||||
if (heightSplitBox.getWidthIsBucketSize()) {
|
||||
assert(numTiles < bucketBoxListSize);
|
||||
bucketBoxList[numTiles++] = heightSplitBox;
|
||||
assert(numTiles <= bucketBoxListSize);
|
||||
} else {
|
||||
for (unsigned i = 0; i < _lonFactors[widthLevel]; ++i) {
|
||||
BucketBox childBox = _intersection(heightSplitBox, heightSplitBox.getSubBoxWidth(i, widthLevel + 1));
|
||||
if (childBox.empty())
|
||||
continue;
|
||||
|
||||
assert(numTiles < bucketBoxListSize);
|
||||
bucketBoxList[numTiles++] = childBox;
|
||||
assert(numTiles <= bucketBoxListSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user