mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-04-30 00:00:01 -04:00
#713 PSD: Broken uncompressed reading from stream w/unknown length
(cherry picked from commit da800be8c8)
This commit is contained in:
+2
-1
@@ -103,7 +103,8 @@ final class PSDUtil {
|
||||
final int[] byteCounts, long compressedLength) throws IOException {
|
||||
switch (compression) {
|
||||
case PSD.COMPRESSION_NONE:
|
||||
return new SubImageInputStream(stream, stream.length());
|
||||
long streamLength = stream.length();
|
||||
return new SubImageInputStream(stream, streamLength < 0 ? Long.MAX_VALUE : streamLength);
|
||||
|
||||
case PSD.COMPRESSION_RLE:
|
||||
return new DirectImageInputStream(new SequenceInputStream(new LazyPackBitsStreamEnumeration(byteCounts, stream)));
|
||||
|
||||
Reference in New Issue
Block a user