Fix tight decoding when using binary/non-base64 connection.

This commit is contained in:
Joel Martin 2012-08-15 12:45:53 -05:00
parent 4dd1bb1ecb
commit 14717eb468
2 changed files with 7 additions and 3 deletions

View File

@ -1252,11 +1252,11 @@ encHandlers.HEXTILE = function display_hextile() {
rQi += FBU.bytes - 1;
} else {
if (FBU.subencoding & 0x02) { // Background
FBU.background = rQ.slice(rQi, rQi + fb_Bpp);
FBU.background = rQ.subarray(rQi, rQi + fb_Bpp);
rQi += fb_Bpp;
}
if (FBU.subencoding & 0x04) { // Foreground
FBU.foreground = rQ.slice(rQi, rQi + fb_Bpp);
FBU.foreground = rQ.subarray(rQi, rQi + fb_Bpp);
rQi += fb_Bpp;
}
@ -1266,7 +1266,7 @@ encHandlers.HEXTILE = function display_hextile() {
rQi += 1;
for (s = 0; s < subrects; s += 1) {
if (FBU.subencoding & 0x10) { // SubrectsColoured
color = rQ.slice(rQi, rQi + fb_Bpp);
color = rQ.subarray(rQi, rQi + fb_Bpp);
rQi += fb_Bpp;
} else {
color = FBU.foreground;

View File

@ -18,6 +18,10 @@ var Util = {};
* Make arrays quack
*/
Array.prototype.subarray = function (start, end) {
this.slice(start, end);
};
Array.prototype.push8 = function (num) {
this.push(num & 0xFF);
};