[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] [9] RFR: JDK-8140530, , Creating a VolatileImage with size 0,
From:       prasanta sadhukhan <prasanta.sadhukhan () oracle ! com>
Date:       2015-11-30 8:55:09
Message-ID: 565C0C1D.3080408 () oracle ! com
[Download RAW message or body]

Hi All,

Please review a fix for jdk9
Bug: https://bugs.openjdk.java.net/browse/JDK-8140530
webrev: http://cr.openjdk.java.net/~psadhukhan/8140530/webrev.00/

The issue was creating a volatileImage with 0 width, height does not 
result in IllegalArgumentException.
But, when we try to create a non-volatile Image via 
GraphicsConfiguration.createCompatibleImage(0,0) or a 
BufferedImage(0,0,imagetype) it results in IAE.
So, to maintain consistency across all image w.r.t 0 width,height, 
createVolatileImage() should also throw IAE.

In windows, creating a volatileImage with 0 width,height resulted in IAE 
but in linux it does not.

This is because XCreatePixmap() generate BadValue unless width,height is 
nonzero but the error handler does not catch it.
https://tronche.com/gui/x/xlib/pixmap-and-cursor/XCreatePixmap.html [The 
width and height arguments must be nonzero, or a *BadValue* error results.]

I have added a check to prevent zero width,height to be used for 
XCreatePixmap() and also throw OOME so to ask Java to throw IAE.

Regards
Prasanta

[Attachment #3 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi All,<br>
    <br>
    Please review a fix for jdk9 <br>
    Bug: <a class="moz-txt-link-freetext" \
href="https://bugs.openjdk.java.net/browse/JDK-8140530">https://bugs.openjdk.java.net/browse/JDK-8140530</a><br>
  webrev: <a class="moz-txt-link-freetext" \
href="http://cr.openjdk.java.net/~psadhukhan/8140530/webrev.00/">http://cr.openjdk.java.net/~psadhukhan/8140530/webrev.00/</a><br>
  <br>
    The issue was creating a volatileImage with 0 width, height does not
    result in IllegalArgumentException.<br>
    But, when we try to create a non-volatile Image via
    GraphicsConfiguration.createCompatibleImage(0,0) or a
    BufferedImage(0,0,imagetype) it results in IAE.<br>
    So, to maintain consistency across all image w.r.t 0 width,height,
    createVolatileImage() should also throw IAE.<br>
    <br>
    In windows, creating a volatileImage with 0 width,height resulted in
    IAE but in linux it does not. <br>
    <br>
    This is because XCreatePixmap() generate BadValue unless
    width,height is nonzero but the error handler does not catch it.<br>
    <a class="moz-txt-link-freetext" \
href="https://tronche.com/gui/x/xlib/pixmap-and-cursor/XCreatePixmap.html">https://tronche.com/gui/x/xlib/pixmap-and-cursor/XCreatePixmap.html</a>
  [The width and height arguments must be nonzero,
    or a <b>BadValue</b>
    error results.]<br>
    <br>
    I have added a check to prevent zero width,height to be used for
    XCreatePixmap() and also throw OOME so to ask Java to throw IAE.<br>
    <br>
    Regards<br>
    Prasanta<br>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic