From 89d1602185066ff540b6525bf99eb894004aad04 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 26 Mar 2020 22:45:43 +0100 Subject: [PATCH] Fix expected message length for touch events The expected length for a touch event control message was incorrect. As a consequence, a BufferUnderflowException could occur. Fixes #1245 --- .../main/java/com/genymobile/scrcpy/ControlMessageReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java b/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java index 70459913..065688a6 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java +++ b/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java @@ -9,7 +9,7 @@ import java.nio.charset.StandardCharsets; public class ControlMessageReader { private static final int INJECT_KEYCODE_PAYLOAD_LENGTH = 9; - private static final int INJECT_TOUCH_EVENT_PAYLOAD_LENGTH = 21; + private static final int INJECT_TOUCH_EVENT_PAYLOAD_LENGTH = 27; private static final int INJECT_SCROLL_EVENT_PAYLOAD_LENGTH = 20; private static final int SET_SCREEN_POWER_MODE_PAYLOAD_LENGTH = 1;