8147077: IllegalArgumentException thrown by api/java_awt/Component/FlipBufferStrategy/indexTGF_General
Reviewed-by: flar, arapte
This commit is contained in:
parent
e421ede779
commit
d66549f6f6
@ -452,8 +452,12 @@ public class X11GraphicsConfig extends GraphicsConfiguration
|
|||||||
public VolatileImage createBackBufferImage(Component target,
|
public VolatileImage createBackBufferImage(Component target,
|
||||||
long backBuffer)
|
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,
|
return new SunVolatileImage(target,
|
||||||
target.getWidth(), target.getHeight(),
|
w, h,
|
||||||
Long.valueOf(backBuffer));
|
Long.valueOf(backBuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user