aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-08-29 15:46:27 +0900
committerSatoshi Kataoka <satok@google.com>2013-08-29 15:47:47 +0900
commit4994e1f2ba669c8636f028594cfc8f757f44d374 (patch)
treed7c5b2fe49062523f2e75f5272a3b50e2328dd51 /java/src
parentfcc6ab08ae29501b07b2dd6b1b56570cdcf4b624 (diff)
downloadlatinime-4994e1f2ba669c8636f028594cfc8f757f44d374.tar.gz
latinime-4994e1f2ba669c8636f028594cfc8f757f44d374.tar.xz
latinime-4994e1f2ba669c8636f028594cfc8f757f44d374.zip
Workaround for AIOOB exception in ProximityInfo
Bug: 10537485 Change-Id: I185f17dcb2cd9e3af17a1eafefaa487804d5cce9
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/ProximityInfo.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
index c0c02f10a..cd127c760 100644
--- a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
+++ b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
@@ -342,7 +342,9 @@ y |---+---+---+---+-v-+-|-+---+---+---+---+---| | thresholdBase and get
for (int centerY = yStart; centerY <= yEnd; centerY += mCellHeight) {
int index = baseIndexOfCurrentRow;
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;
++neighborCountPerCell[index];
}