Skip to content

Commit 8fa6503

Browse files
author
Fabrice Di Meglio
committed
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
1 parent 3efc794 commit 8fa6503

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphics/java/android/graphics/Paint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ public int breakText(char[] text, int index, int count,
13491349
if (text == null) {
13501350
throw new IllegalArgumentException("text cannot be null");
13511351
}
1352-
if ((index | count) < 0 || index + count > text.length) {
1352+
if (index < 0 || text.length - index < Math.abs(count)) {
13531353
throw new ArrayIndexOutOfBoundsException();
13541354
}
13551355

0 commit comments

Comments
 (0)