提交 55e32c2f 编写于 作者: P prr

8225292: Better Graphics2D drawing

Reviewed-by: serb, psadhukhan, mschoene, rhalade
上级 ae2f49e8
......@@ -3020,7 +3020,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()) {
......@@ -3052,7 +3053,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.
先完成此消息的编辑!
想要评论请 注册