Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6294965

BMP Writer throws exception when writing TYPE_BYTE_BINARY image with BI_BITFIELDS compression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • client-libs

      I am writing a buffered image of type BYTE_BINARY to a file using BMP Writer. Compression Mode is set to MODE_EXPLICIT and compression type is set to BI_BITFIELDS. The image as well as compression modes are supported by the ImageWriter. When I call the write() method of the writer, I am getting an ArrayIndexOutOfBoundsException.

      Here is the exception:
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
      at com.sun.imageio.plugins.bmp.BMPImageWriter.write(BMPImageWriter.java:455)
      at BMPWriterByteBinaryTest.<init>(BMPWriterByteBinaryTest.java:119)
      at BMPWriterByteBinaryTest.main(BMPWriterByteBinaryTest.java:209)

      This is reproducible on all platforms since Tiger-FCS.

      I have attached a sample test and the image. Run the sample test with any mustang build and you will see the above exception on the console.
      ###@###.### 2005-07-08 12:49:05 GMT

            bae Andrew Brygin
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: