--- old/src/java.desktop/share/classes/sun/awt/CustomCursor.java 2017-03-02 20:47:01.738368600 +0300 +++ new/src/java.desktop/share/classes/sun/awt/CustomCursor.java 2017-03-02 20:46:59.527087800 +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);