summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-01-27 18:35:40 -0800
committerGilles Debunne <debunne@google.com>2011-01-27 18:39:42 -0800
commit1feba8bb02d26225f6ab013d50889a4d2e0c56f3 (patch)
tree8d9136e1763bcda442c2e4a48c1fa8737a1223f9 /graphics/java
parent270cbcc16a72f982d84afeb5e3fd3f166936394a (diff)
downloadframeworks_base-1feba8bb02d26225f6ab013d50889a4d2e0c56f3.zip
frameworks_base-1feba8bb02d26225f6ab013d50889a4d2e0c56f3.tar.gz
frameworks_base-1feba8bb02d26225f6ab013d50889a4d2e0c56f3.tar.bz2
Fix for an IOOBoundsException in Paint.
Bug 3331706 The temporary buffer starts at index 0 and shifts indexes by contextStart. offset has to be changed accordingly. Note that I didn't try to reproduce the monkey bug after this fix, but it seems like a perfect explanation for the exception. Change-Id: Ie69adc413670caed283bc46effc69f17a102922c
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/Paint.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index b739d83..d8a7f9d 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1690,7 +1690,7 @@ public class Paint {
int contextLen = contextEnd - contextStart;
char[] buf = TemporaryBuffer.obtain(contextLen);
TextUtils.getChars(text, contextStart, contextEnd, buf, 0);
- int result = getTextRunCursor(buf, 0, contextLen, flags, offset, cursorOpt);
+ int result = getTextRunCursor(buf, 0, contextLen, flags, offset - contextStart, cursorOpt);
TemporaryBuffer.recycle(buf);
return result;
}