8147077: IllegalArgumentException thrown by api/java_awt/Component/FlipBufferStrategy/indexTGF_General
Reviewed-by: flar, arapte
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java Tue Jan 26 13:05:21 2016 +0300
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java Wed Jan 27 14:12:05 2016 +0530
@@ -452,8 +452,12 @@
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));
}