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

PIT: GIFImageWriter.reset() throws NullPointerException

XMLWordPrintable

    • beta
    • generic
    • generic
    • Verified

      I am creating an ImageOutputStream and setting it to the writer by calling writer.setOutput(ios). After this, I am calling writer.reset() and trying to write the buffered image. I expect the GIF writer to throw IllegalStateException (output not set) as per the specification. But GIF Writer throws a NullPointerException when calling reset().

      This is reproducible on all platforms with the following PIT build:
      java version "1.6.0-2d.pit-jcg-win-03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-2d.pit-jcg-win-03-java2d_23_may_2005_02_25-b00)
      Java HotSpot(TM) Client VM (build 1.6.0-ea-b37, mixed mode)

      Here is the exception:
      java.lang.NullPointerException
      at com.sun.imageio.plugins.gif.GIFImageWriter.setOutput(GIFImageWriter.java:426)
      at javax.imageio.ImageWriter.reset(ImageWriter.java:1994)
      at com.sun.imageio.plugins.gif.GIFImageWriter.reset(GIFImageWriter.java:407)
      at WriteAbortTest.<init>(WriteAbortTest.java:29)
      at WriteAbortTest.main(WriteAbortTest.java:85)

      I have attached a sample test. Execute the sample test and pass the image format as 'gif' and pass the attached image file. You would see the above exception on the console.
      ###@###.### 2005-05-24 15:03:55 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: