Fixed bug with remaining data in buffer after BACK_OR_SCREEN_ON command.

This commit is contained in:
Vladimir Chebotarev 2020-09-06 02:42:54 +03:00
parent 275b0acbbe
commit b42339ed03

View file

@ -174,7 +174,7 @@ public class ControlMessageReader {
}
private ControlMessage parseBackOrScreenOn() {
if (buffer.remaining() != BACK_OR_SCREEN_ON_PAYLOAD_LENGTH) {
if (buffer.remaining() < BACK_OR_SCREEN_ON_PAYLOAD_LENGTH) {
return null;
}
boolean screenOnOnly = buffer.get() != 0;