mirror of
https://github.com/PaperMC/Velocity.git
synced 2024-11-27 06:30:35 +08:00
Better check for unfinished decompression
This commit is contained in:
parent
563a96e624
commit
3d0cb50569
@ -78,9 +78,9 @@ public class Java11VelocityCompressor implements VelocityCompressor {
|
|||||||
destination.writerIndex(destination.writerIndex() + produced);
|
destination.writerIndex(destination.writerIndex() + produced);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inflater.getBytesWritten() != uncompressedSize) {
|
if (!inflater.finished()) {
|
||||||
throw new DataFormatException("Did not write the exact expected number of"
|
throw new DataFormatException("Received a deflate stream that was too large, wanted "
|
||||||
+ " uncompressed bytes, expected " + uncompressedSize);
|
+ uncompressedSize);
|
||||||
}
|
}
|
||||||
source.readerIndex(origIdx + inflater.getTotalIn());
|
source.readerIndex(origIdx + inflater.getTotalIn());
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user