changeset 16852:75a8a6117014

8173853: IllegalArgumentException in java.awt.image.ReplicateScaleFilter Reviewed-by: prr, serb
author dmarkov
date Tue, 14 Mar 2017 09:03:43 +0300
parents 48ddfeefafac
children 23f609916fba
files src/java.desktop/share/classes/sun/awt/CustomCursor.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/sun/awt/CustomCursor.java	Tue Mar 14 10:29:13 2017 +0530
+++ b/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);