Increase (de)compress buffer sizes

This commit is contained in:
DBotThePony 2023-03-03 21:26:44 +07:00
parent 36c14be025
commit 04a5e87fec
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1413,7 +1413,7 @@ object MatterManager {
inflater.setInput(bbytes)
while (!inflater.finished()) {
val chunk = ByteArray(4096)
val chunk = ByteArray(2 shl 16)
val inflated = inflater.inflate(chunk)
if (inflated == 0) {
@ -1425,7 +1425,7 @@ object MatterManager {
throw IndexOutOfBoundsException("Pipe Bomb")
}
if (inflated == 4096) {
if (inflated == 2 shl 16) {
chunks.add(chunk)
} else {
chunks.add(chunk.copyOfRange(0, inflated))
@ -1513,7 +1513,7 @@ object MatterManager {
deflater.setInput(stream.array, 0, stream.length)
deflater.finish()
val bytes = ByteArray(4096)
val bytes = ByteArray(2 shl 16)
while (true) {
val written = deflater.deflate(bytes)