[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/37128] New: Null pointer exception in BMPImageWriterSpi.c
From: |
mathieu dot baron at gmail dot com |
Subject: |
[Bug classpath/37128] New: Null pointer exception in BMPImageWriterSpi.canEncodeImage() |
Date: |
15 Aug 2008 13:19:02 -0000 |
A Null pointer exception occurs in BMPImageWriterSpi.canEncodeImage() when the
writer instance is not assigned.
Current code:
BMPInfoHeader ih = writerInstance.infoHeader;
Proposed solution:
call "getWriterInstance()" which will create a new instance of
the writer if not already created.
Example:
BMPInfoHeader ih = getWriterInstance().infoHeader;
How to Reproduce:
// Read an image file
BufferedImage bufferredImage = ImageIO.read(pInputFile);
// Save it using Bitmap format: this will call
// the method "BMPImageWriterSpi.canEncodeImage()" but the
// WriterInstance will be null.
boolean success = ImageIO.write(bufferredImage,
"Microsoft Windows BMP", pOutputfile);
--
Summary: Null pointer exception in
BMPImageWriterSpi.canEncodeImage()
Product: classpath
Version: 0.97.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mathieu dot baron at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37128
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/37128] New: Null pointer exception in BMPImageWriterSpi.canEncodeImage(),
mathieu dot baron at gmail dot com <=