Hello All,

 

Please review the following fix in JDK10 :

 

Bug : https://bugs.openjdk.java.net/browse/JDK-8190512 

Webrev : http://cr.openjdk.java.net/~jdv/8190512/webrev.00/ 

 

Issue : PNGImageReader throws "java.lang.IllegalArgumentException: Empty 
region!" when the IHDR width/height value in the header is negative.

 

Root cause : In PNGImageReader.readHeader() we only check whether the IHDR 
width/height is not equal to 0(which is compliant with PNG specification), we 
don't check whether the value is negative or not.

 

Solution : Although PNG specification mentions only 0 as invalid value for IHDR 
width/height we should also not allow IHDR width/height with negative values. 
Extend the check present in PNGImageReader.readHeader() to verify negative 
values for IHDR width and height.

 

Thanks,

Jay

 

Reply via email to