8173853: IllegalArgumentException in java.awt.image.ReplicateScaleFilter
authordmarkov
Tue, 14 Mar 2017 09:03:43 +0300
changeset 44344 e06a7379b9c7
parent 44343 f0c8e3d65331
child 44345 335a8cfc6d70
8173853: IllegalArgumentException in java.awt.image.ReplicateScaleFilter Reviewed-by: prr, serb
jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java
--- a/jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java	Tue Mar 14 10:29:13 2017 +0530
+++ b/jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java	Tue Mar 14 09:03:43 2017 +0300
@@ -66,7 +66,8 @@
 
         // Scale image to nearest supported size.
         Dimension nativeSize = toolkit.getBestCursorSize(width, height);
-        if (nativeSize.width != width || nativeSize.height != height) {
+        if ((nativeSize.width != width || nativeSize.height != height) &&
+            (nativeSize.width != 0 && nativeSize.height != 0)) {
             cursor = cursor.getScaledInstance(nativeSize.width,
                                               nativeSize.height,
                                               Image.SCALE_DEFAULT);