8267735: Better BMP support
Reviewed-by: prr, rhalade, azvegint, ahgross, mschoene
This commit is contained in:
parent
3470e7b300
commit
c70f7cad47
@ -591,6 +591,13 @@ public class BMPImageReader extends ImageReader implements BMPConstants {
|
||||
height = Math.abs(height);
|
||||
}
|
||||
|
||||
if (metadata.compression == BI_RGB) {
|
||||
long imageDataSize = (width * height * (bitsPerPixel / 8));
|
||||
if (imageDataSize > (bitmapFileSize - bitmapOffset)) {
|
||||
throw new IIOException(I18N.getString("BMPImageReader9"));
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Image Layout so there's only one tile.
|
||||
//Define the color space
|
||||
ColorSpace colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
|
||||
|
@ -24,6 +24,7 @@ BMPImageReader5=Input has not been set.
|
||||
BMPImageReader6=Unable to read the image header.
|
||||
BMPImageReader7=Invalid bitmap offset.
|
||||
BMPImageReader8=Invalid bits per pixel in image header.
|
||||
BMPImageReader9=Invalid width/height for BI_RGB image data.
|
||||
BMPImageWriter0=Output is not an ImageOutputStream.
|
||||
BMPImageWriter1=The image region to be encoded is empty.
|
||||
BMPImageWriter2=Only 1 or 3 band image is encoded.
|
||||
|
Loading…
Reference in New Issue
Block a user