-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
generic
-
generic
Name: mlR10151 Date: 04/19/2001
Method write(int) of the FileImageOutputStream class falls into an infinite loop.
To reproduce the bug run the following test:
========================== a.java =============================
import java.io.*;
import javax.imageio.stream.*;
public class a {
public static void main (String argv[]) throws Exception {
System.setSecurityManager(null);
File tempFile = File.createTempFile("test", "tmp");
FileImageOutputStream fios = new FileImageOutputStream(tempFile);
fios.writeBits(0xFFFFFFFFFFFFFFFFL, 0);
fios.write(1);
fios.seek(0);
fios.writeBits(0xFFFFFFFFFFFFFFFFL, 1);
fios.write(1);
System.out.println("Passed");
}
}
==========================log========================
% java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b60)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b60, mixed mode)
% java a
Exception in thread "main" java.lang.StackOverflowError
at javax.imageio.stream.FileImageOutputStream.write(FileImageOutputStream.java:87)
at javax.imageio.stream.ImageOutputStreamImpl.flushBits(ImageOutputStreamImpl.java:435)
at javax.imageio.stream.FileImageOutputStream.write(FileImageOutputStream.java:87)
at javax.imageio.stream.ImageOutputStreamImpl.flushBits(ImageOutputStreamImpl.java:435)
. . .
This bug causes failure of the new JCK test
api/javax_imageio/stream/FileImageOutputStream/index.html#write
======================================================================