Workaround for AIOOB exception in ProximityInfo
Bug: 10537485 Change-Id: I185f17dcb2cd9e3af17a1eafefaa487804d5cce9
This commit is contained in:
parent
fcc6ab08ae
commit
4994e1f2ba
1 changed files with 3 additions and 1 deletions
|
@ -342,7 +342,9 @@ y |---+---+---+---+-v-+-|-+---+---+---+---+---| | thresholdBase and get
|
||||||
for (int centerY = yStart; centerY <= yEnd; centerY += mCellHeight) {
|
for (int centerY = yStart; centerY <= yEnd; centerY += mCellHeight) {
|
||||||
int index = baseIndexOfCurrentRow;
|
int index = baseIndexOfCurrentRow;
|
||||||
for (int centerX = xStart; centerX <= xEnd; centerX += mCellWidth) {
|
for (int centerX = xStart; centerX <= xEnd; centerX += mCellWidth) {
|
||||||
if (key.squaredDistanceToEdge(centerX, centerY) < thresholdSquared) {
|
// TODO: Remove "index < neighborCountPerCell.length" below.
|
||||||
|
if (index < neighborCountPerCell.length
|
||||||
|
&& key.squaredDistanceToEdge(centerX, centerY) < thresholdSquared) {
|
||||||
neighborsFlatBuffer[index * keyCount + neighborCountPerCell[index]] = key;
|
neighborsFlatBuffer[index * keyCount + neighborCountPerCell[index]] = key;
|
||||||
++neighborCountPerCell[index];
|
++neighborCountPerCell[index];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue