summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-11-14 20:54:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-14 20:54:29 +0000
commit505ffe3633f45778e493e23ad8c163f09ed1dbb5 (patch)
tree0dda3eb9cf8d365b48c500e0c5fcd40b51154073 /graphics/java
parent25f7c4b99284cd1e118f50bd585e6534acfad7c4 (diff)
parentd82f8a9a3869448e6d7d4b3fc962e34e33a1ba0e (diff)
downloadframeworks_base-505ffe3633f45778e493e23ad8c163f09ed1dbb5.zip
frameworks_base-505ffe3633f45778e493e23ad8c163f09ed1dbb5.tar.gz
frameworks_base-505ffe3633f45778e493e23ad8c163f09ed1dbb5.tar.bz2
Merge "Check bounds on CharSequence drawText methods" into lmp-mr1-dev
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/Canvas.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 8279a51..499608e 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1710,6 +1710,9 @@ public class Canvas {
*/
public void drawText(@NonNull CharSequence text, int start, int end, float x, float y,
@NonNull Paint paint) {
+ if ((start | end | (end - start) | (text.length() - end)) < 0) {
+ throw new IndexOutOfBoundsException();
+ }
if (text instanceof String || text instanceof SpannedString ||
text instanceof SpannableString) {
native_drawText(mNativeCanvasWrapper, text.toString(), start, end, x, y,