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

Writing an empty ARGB BufferedImage using GIF Writer throws NullPointerException

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b14
    • CPU:
      generic, x86, arm
    • OS:
      generic, linux, windows_xp
    • Verification:
      Verified

      Description

      I am creating a buffered image of type TYPE_INT_ARGB with a specific size. I am getting the GIF writer from the registry and writing this empty, transparent buffered image to a file. As soon as I call, writer.write(bi), I am getting a NullPointerException on the console.

      This is reproducible on all platforms. This is not reproducible for other writers and occurs only for GIF. This is seen since Mustang-b39.

      I have attached a sample test. Execute the sample test. If you see the following exception on the console, the bug is reproduced.

      java.lang.NullPointerException
      at com.sun.imageio.plugins.common.PaletteBuilder.findPaletteEntry(PaletteBuilder.java:310)
      at com.sun.imageio.plugins.common.PaletteBuilder.getIndexColorModel(PaletteBuilder.java:296)
      at com.sun.imageio.plugins.common.PaletteBuilder.getIndexedImage(PaletteBuilder.java:145)
      at com.sun.imageio.plugins.common.PaletteBuilder.createIndexedImage(PaletteBuilder.java:77)
      at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:569)
      at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:499)
      at javax.imageio.ImageWriter.write(ImageWriter.java:598)
      at WriteARGBEmptyImage.<init>(WriteARGBEmptyImage.java:30)
      at WriteARGBEmptyImage.main(WriteARGBEmptyImage.java:41)

      ###@###.### 2005-06-20 12:44:39 GMT

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: