8147077: IllegalArgumentException thrown by api/java_awt/Component/FlipBufferStrategy/indexTGF_General

Reviewed-by: flar, arapte
This commit is contained in:
Prasanta Sadhukhan 2016-01-27 14:12:05 +05:30
parent e421ede779
commit d66549f6f6

View File

@ -452,8 +452,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));
}