提交 0807eb6b 编写于 作者: P prr

8225292: Better Graphics2D drawing

Reviewed-by: serb, psadhukhan, mschoene, rhalade
上级 c2f4135f
......@@ -3021,7 +3021,8 @@ public final class SunGraphics2D
if (data == null) {
throw new NullPointerException("char data is null");
}
if (offset < 0 || length < 0 || offset + length > data.length) {
if (offset < 0 || length < 0 || offset + length < length ||
offset + length > data.length) {
throw new ArrayIndexOutOfBoundsException("bad offset/length");
}
if (font.hasLayoutAttributes()) {
......@@ -3053,7 +3054,8 @@ public final class SunGraphics2D
if (data == null) {
throw new NullPointerException("byte data is null");
}
if (offset < 0 || length < 0 || offset + length > data.length) {
if (offset < 0 || length < 0 || offset + length < length ||
offset + length > data.length) {
throw new ArrayIndexOutOfBoundsException("bad offset/length");
}
/* Byte data is interpreted as 8-bit ASCII. Re-use drawChars loops */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册