diff --git a/src/solaris/classes/sun/awt/X11GraphicsConfig.java b/src/solaris/classes/sun/awt/X11GraphicsConfig.java index 9055bf0e2d67b1286df92c80077b3809c7de1a09..d1ddc22bcac7e4fc1406b6220dcfdee75c21e2ba 100644 --- a/src/solaris/classes/sun/awt/X11GraphicsConfig.java +++ b/src/solaris/classes/sun/awt/X11GraphicsConfig.java @@ -435,8 +435,12 @@ public class X11GraphicsConfig extends GraphicsConfiguration public VolatileImage createBackBufferImage(Component target, long backBuffer) { + // it is possible for the component to have size 0x0, adjust it to + // be at least 1x1 to avoid IAE + int w = Math.max(1, target.getWidth()); + int h = Math.max(1, target.getHeight()); return new SunVolatileImage(target, - target.getWidth(), target.getHeight(), + w, h, Long.valueOf(backBuffer)); } diff --git a/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java b/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java index b0f04e337a39c1128cb18e2be190866874ab8118..c2bd2adb0d8c66274890866614145b7fb9fb085f 100644 --- a/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java +++ b/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java @@ -323,8 +323,12 @@ public class WGLGraphicsConfig @Override public VolatileImage createBackBuffer(WComponentPeer peer) { Component target = (Component)peer.getTarget(); + // it is possible for the component to have size 0x0, adjust it to + // be at least 1x1 to avoid IAE + int w = Math.max(1, target.getWidth()); + int h = Math.max(1, target.getHeight()); return new SunVolatileImage(target, - target.getWidth(), target.getHeight(), + w, h, Boolean.TRUE); }