]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Fix tight decoding when using binary/non-base64 connection.
authorJoel Martin <github@martintribe.org>
Wed, 15 Aug 2012 17:45:53 +0000 (12:45 -0500)
committerJoel Martin <github@martintribe.org>
Wed, 15 Aug 2012 17:45:53 +0000 (12:45 -0500)
include/rfb.js
include/util.js

index 00fb7d8852fcee6560ded28d659e005a8b855224..2a321d242554adeb860aae3a32c16dd4e0ec00b1 100644 (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;
index 57ccb540804669a853243c4d03027882f6140e26..030afb41373ac7cbea8a63027bfbbf916cc9a78c 100644 (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);
 };