#955: PSD: Fix overflow issue found in GIMP PSD

This commit is contained in:
Harald Kuhr
2024-06-04 22:52:03 +02:00
parent 83cff35076
commit fa49dd93a7
3 changed files with 5 additions and 2 deletions
@@ -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);
}
}
}