Return unsigned values from rQshift32()

This is what we almost always want, and this makes it consistent with
rQshift8() and rQshift16().
This commit is contained in:
Pierre Ossman 2023-06-04 14:50:35 +02:00
parent d0203a5995
commit 0ccc679d32
2 changed files with 3 additions and 1 deletions

View File

@ -2491,6 +2491,8 @@ export default class RFB extends EventTargetMixin {
this._FBU.width = this._sock.rQshift16();
this._FBU.height = this._sock.rQshift16();
this._FBU.encoding = this._sock.rQshift32();
/* Encodings are signed */
this._FBU.encoding >>= 0;
}
if (!this._handleRect()) {

View File

@ -121,7 +121,7 @@ export default class Websock {
for (let byte = bytes - 1; byte >= 0; byte--) {
res += this._rQ[this._rQi++] << (byte * 8);
}
return res;
return res >>> 0;
}
rQshiftStr(len) {