From 95adfc6e3df40492ad1c158404a73f72305f67c6 Mon Sep 17 00:00:00 2001 From: Manevolent Date: Sat, 4 Aug 2018 23:01:03 -0400 Subject: [PATCH] Ignore compressed packets for voice, there is an issue --- .../protocol/socket/client/LocalTeamspeakClientSocket.java | 1 - src/main/java/com/github/manevolent/ts3j/util/QuickLZ.java | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java b/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java index 6880bcb..bb94e57 100644 --- a/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java +++ b/src/main/java/com/github/manevolent/ts3j/protocol/socket/client/LocalTeamspeakClientSocket.java @@ -21,7 +21,6 @@ import com.github.manevolent.ts3j.protocol.packet.PacketBody2Command; import com.github.manevolent.ts3j.util.HighPrecisionRecurrentTask; import com.github.manevolent.ts3j.util.Ts3Debugging; -import java.io.Closeable; import java.io.IOException; import java.net.*; import java.nio.ByteBuffer; diff --git a/src/main/java/com/github/manevolent/ts3j/util/QuickLZ.java b/src/main/java/com/github/manevolent/ts3j/util/QuickLZ.java index 858d97f..a47ede0 100644 --- a/src/main/java/com/github/manevolent/ts3j/util/QuickLZ.java +++ b/src/main/java/com/github/manevolent/ts3j/util/QuickLZ.java @@ -12,6 +12,8 @@ package com.github.manevolent.ts3j.util;// QuickLZ data compression library // // Version: 1.5.0 final +import java.util.Base64; + public final class QuickLZ { // Streaming mode not supported @@ -310,6 +312,8 @@ public final class QuickLZ static public byte[] decompress(byte[] source) { int size = (int)sizeDecompressed(source); + if (size > 65536) throw new IllegalArgumentException("decompression too large: " + size + " (" + Base64.getEncoder().encodeToString(source) + ")"); + int src = headerLen(source); int dst = 0; long cword_val = 1;