diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-08-29 18:38:27 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2011-08-30 15:01:39 -0700 |
commit | 8fa6503feb1954d8c11a0591a567e6acedf7abe9 (patch) | |
tree | 41f1f52313a6dd657419c06d556b97f8f1cd1858 /graphics/java | |
parent | 3efc794f8563558b9792cc8ffa1ab9e81a0129ea (diff) | |
download | frameworks_base-8fa6503feb1954d8c11a0591a567e6acedf7abe9.zip frameworks_base-8fa6503feb1954d8c11a0591a567e6acedf7abe9.tar.gz frameworks_base-8fa6503feb1954d8c11a0591a567e6acedf7abe9.tar.bz2 |
Fix bug #5233207 android.graphics.cts.PaintTest#testBreakText fails on IRK56F trygon-userdebug
- Paint.breakText() API was regressing on the argument validation: a count < 0 is a valid one
Change-Id: I6d09294ee9f21901ba00017ce0d73f757fc7b147
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/Paint.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index cde997e..048d09c 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -1349,7 +1349,7 @@ public class Paint { if (text == null) { throw new IllegalArgumentException("text cannot be null"); } - if ((index | count) < 0 || index + count > text.length) { + if (index < 0 || text.length - index < Math.abs(count)) { throw new ArrayIndexOutOfBoundsException(); } |