< prev index next >
src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
Print this page
@@ -267,15 +267,15 @@
// Skip IHDR CRC
stream.skipBytes(4);
stream.flushBefore(stream.getStreamPosition());
- if (width == 0) {
- throw new IIOException("Image width == 0!");
+ if (width <= 0) {
+ throw new IIOException("Image width <= 0!");
}
- if (height == 0) {
- throw new IIOException("Image height == 0!");
+ if (height <= 0) {
+ throw new IIOException("Image height <= 0!");
}
if (bitDepth != 1 && bitDepth != 2 && bitDepth != 4 &&
bitDepth != 8 && bitDepth != 16) {
throw new IIOException("Bit depth must be 1, 2, 4, 8, or 16!");
}
< prev index next >