13
0
geforkt von Mirrors/Velocity

Add missing readable check

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-09-09 15:05:27 -04:00
Ursprung 46aa8efb35
Commit 56a50c60b5

Datei anzeigen

@ -20,6 +20,11 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
byte[] lenBuf = new byte[3]; byte[] lenBuf = new byte[3];
for (int i = 0; i < lenBuf.length; i++) { for (int i = 0; i < lenBuf.length; i++) {
if (!in.isReadable()) {
in.resetReaderIndex();
return;
}
lenBuf[i] = in.readByte(); lenBuf[i] = in.readByte();
if (lenBuf[i] > 0) { if (lenBuf[i] > 0) {
int packetLength = ProtocolUtils.readVarInt(Unpooled.wrappedBuffer(lenBuf)); int packetLength = ProtocolUtils.readVarInt(Unpooled.wrappedBuffer(lenBuf));