aboutsummaryrefslogtreecommitdiff
path: root/src/java.desktop/unix/classes/sun/java2d
diff options
context:
space:
mode:
authorceisserer <unknown>2020-01-14 15:19:49 -0800
committerbell-sw <liberica@bell-sw.com>2020-04-17 14:37:06 +0300
commit74e3269b2492b20c71b00bb52df9ea2ed6f3031d (patch)
treedf2bb4265bf6c54df0a8d1a231777f8a5f84e383 /src/java.desktop/unix/classes/sun/java2d
parent91050d029e3979ca2b68282e1c4284d78729bb47 (diff)
downloadJetBrainsRuntime-74e3269b2492b20c71b00bb52df9ea2ed6f3031d.tar.gz
8235904: Infinite loop when rendering huge lines
Reviewed-by: prr, kizune
Diffstat (limited to 'src/java.desktop/unix/classes/sun/java2d')
-rw-r--r--src/java.desktop/unix/classes/sun/java2d/xr/XRDrawLine.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawLine.java b/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawLine.java
index a3c46ae26da..f2d6b3f15ff 100644
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawLine.java
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRDrawLine.java
@@ -222,7 +222,7 @@ public class XRDrawLine {
outcode2 = outcode(x2, y2, cxmin, cymin, cxmax, cymax);
while ((outcode1 | outcode2) != 0) {
- int xsteps = 0, ysteps = 0;
+ long xsteps = 0, ysteps = 0;
if ((outcode1 & outcode2) != 0) {
return false;
@@ -247,7 +247,7 @@ public class XRDrawLine {
if (dx < 0) {
xsteps = -xsteps;
}
- x1 = ucX1 + xsteps;
+ x1 = ucX1 + (int) xsteps;
} else if ((outcode1 & (OUTCODE_LEFT | OUTCODE_RIGHT)) != 0) {
if ((outcode1 & OUTCODE_LEFT) != 0) {
x1 = cxmin;
@@ -266,7 +266,7 @@ public class XRDrawLine {
if (dy < 0) {
ysteps = -ysteps;
}
- y1 = ucY1 + ysteps;
+ y1 = ucY1 + (int) ysteps;
}
outcode1 = outcode(x1, y1, cxmin, cymin, cxmax, cymax);
} else {
@@ -290,7 +290,7 @@ public class XRDrawLine {
if (dx > 0) {
xsteps = -xsteps;
}
- x2 = ucX2 + xsteps;
+ x2 = ucX2 + (int) xsteps;
} else if ((outcode2 & (OUTCODE_LEFT | OUTCODE_RIGHT)) != 0) {
if ((outcode2 & OUTCODE_LEFT) != 0) {
x2 = cxmin;
@@ -311,7 +311,7 @@ public class XRDrawLine {
if (dy > 0) {
ysteps = -ysteps;
}
- y2 = ucY2 + ysteps;
+ y2 = ucY2 + (int) ysteps;
}
outcode2 = outcode(x2, y2, cxmin, cymin, cxmax, cymax);
}