Handle empty rects from the server
These are very pointless for the server to send, but not a violation of the protocol so we need to be able to handle them. We've seen this happen in real world scenarios a few times.
This commit is contained in:
committed by
Lauri Kasanen
parent
16c72ba0a7
commit
073737c8ac
@@ -15,6 +15,11 @@ export default class CopyRectDecoder {
|
||||
|
||||
let deltaX = sock.rQshift16();
|
||||
let deltaY = sock.rQshift16();
|
||||
|
||||
if ((width === 0) || (height === 0)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display.copyImage(deltaX, deltaY, x, y, width, height);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -162,6 +162,10 @@ export default class TightDecoder {
|
||||
const uncompressedSize = width * height * 3;
|
||||
let data;
|
||||
|
||||
if (uncompressedSize === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (uncompressedSize < 12) {
|
||||
if (sock.rQwait("TIGHT", uncompressedSize)) {
|
||||
return false;
|
||||
@@ -217,6 +221,10 @@ export default class TightDecoder {
|
||||
|
||||
let data;
|
||||
|
||||
if (uncompressedSize === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (uncompressedSize < 12) {
|
||||
if (sock.rQwait("TIGHT", uncompressedSize)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user