< prev index next >

src/solaris/classes/sun/awt/X11GraphicsConfig.java

Print this page
rev 1536 : 8147077: IllegalArgumentException thrown by api/java_awt/Component/FlipBufferStrategy/indexTGF_General
8148127: IllegalArgumentException thrown by JCK test api/java_awt/Component/FlipBufferStrategy/indexTGF_General in opengl pipeline
Reviewed-by: flar, arapte

@@ -422,13 +422,17 @@
      * backbuffer, using the provided backbuffer handle.
      */
     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(),
-                                    new Long(backBuffer));
+                                    w, h,
+                                    Long.valueOf(backBuffer));
     }
 
     /**
      * Performs the native XDBE flip operation for the given target Component.
      */
< prev index next >