mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-27 00:00:02 -04:00
#955: PSD: Fix overflow issue found in GIMP PSD
This commit is contained in:
+2
-1
@@ -142,7 +142,8 @@ final class PSDUtil {
|
||||
|
||||
@Override
|
||||
public InputStream nextElement() {
|
||||
return new SubStream(new DecoderStream(createStreamAdapter(stream, byteCounts[index++]), new PackBitsDecoder(), rowLength), rowLength);
|
||||
// Add 128 bytes extra buffer as worst case if the encoder (GIMP) added garbage bytes at the end
|
||||
return new SubStream(new DecoderStream(createStreamAdapter(stream, byteCounts[index++]), new PackBitsDecoder(), rowLength + 128), rowLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user