You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Testing release 3.10.0, I found a few malformed PSD images that never return from ImageIO.read() (once the reading function is called, no exception is thrown but it never returns). Using 3.9.4, an exception was thrown, as expected.
Version information
The version of the TwelveMonkeys ImageIO library in use: 3.10.0. It also happens using the master branch.
The exact output of java --version:
openjdk version "11.0.13" 2021-10-19 LTS
OpenJDK Runtime Environment (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM (build 11.0.13+8-LTS, mixed mode, sharing)
Extra information about OS version, server version, standalone program or web application packaging, executable wrapper, etc.
I tested it on Windows 11.
To Reproduce
Run a simple standalone program (below), using the PSD ImageIO plugin 3.10.0.
Expected behavior
As the sample images are malformed/incomplete, an exception should be thrown.
Stack trace
Running with the test program using 3.10.0, no exception is thrown and the program never finishes.
Running with 3.9.4, I got the following exception, which was expected because the sample images are malformed/incomplete.
Exception in thread "main" java.io.EOFException: Unexpected end of PackBits stream
at com.twelvemonkeys.io.enc.PackBitsDecoder.readFully(PackBitsDecoder.java:186)
at com.twelvemonkeys.io.enc.PackBitsDecoder.decode(PackBitsDecoder.java:143)
at com.twelvemonkeys.io.enc.DecoderStream.fill(DecoderStream.java:179)
at com.twelvemonkeys.io.enc.DecoderStream.read(DecoderStream.java:123)
at java.base/java.io.SequenceInputStream.read(SequenceInputStream.java:199)
at com.twelvemonkeys.imageio.stream.DirectImageInputStream.read(DirectImageInputStream.java:73)
at java.desktop/javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:351)
at com.twelvemonkeys.imageio.plugins.psd.PSDImageReader.read8bitChannel(PSDImageReader.java:656)
at com.twelvemonkeys.imageio.plugins.psd.PSDImageReader.readImageData(PSDImageReader.java:480)
at com.twelvemonkeys.imageio.plugins.psd.PSDImageReader.read(PSDImageReader.java:429)
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1468)
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1315)
at PSDReadTest.main(PSDReadTest.java:11)
Additional context
I found these 4 sample images that trigger the issue, testing with a set with 1,500 PSD files, collected from different sources, so it seems a somewhat rare issue.
Trying to trace down what is going on, I found out that the execution stops during stream.readFully(rowData, 0, channelWidth); in read8bitChannel method of PSDImageReader class. Not sure why, but it seems that readFully is waiting forever for bytes not available.
The text was updated successfully, but these errors were encountered:
Describe the bug
Testing release 3.10.0, I found a few malformed PSD images that never return from
ImageIO.read()
(once the reading function is called, no exception is thrown but it never returns). Using 3.9.4, an exception was thrown, as expected.Version information
The version of the TwelveMonkeys ImageIO library in use:
3.10.0. It also happens using the master branch.
The exact output of
java --version
:openjdk version "11.0.13" 2021-10-19 LTS
OpenJDK Runtime Environment (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM (build 11.0.13+8-LTS, mixed mode, sharing)
Extra information about OS version, server version, standalone program or web application packaging, executable wrapper, etc.
I tested it on Windows 11.
To Reproduce
Run a simple standalone program (below), using the PSD ImageIO plugin 3.10.0.
Expected behavior
As the sample images are malformed/incomplete, an exception should be thrown.
Example code
Sample files
sample-psd-images.zip
Stack trace
Running with the test program using 3.10.0, no exception is thrown and the program never finishes.
Running with 3.9.4, I got the following exception, which was expected because the sample images are malformed/incomplete.
Additional context
I found these 4 sample images that trigger the issue, testing with a set with 1,500 PSD files, collected from different sources, so it seems a somewhat rare issue.
Trying to trace down what is going on, I found out that the execution stops during
stream.readFully(rowData, 0, channelWidth);
inread8bitChannel
method ofPSDImageReader
class. Not sure why, but it seems thatreadFully
is waiting forever for bytes not available.The text was updated successfully, but these errors were encountered: