Commit eabf4670 authored by Joel Martin's avatar Joel Martin

rfb.js/tight_png: fix indexed receive queue handling.

getCLength was not using the index (RQi) into the receive queue.
...@@ -1348,9 +1348,7 @@ encHandlers.TIGHT_PNG = function display_tight_png() { ...@@ -1348,9 +1348,7 @@ encHandlers.TIGHT_PNG = function display_tight_png() {
//Util.Debug(">> display_tight_png"); //Util.Debug(">> display_tight_png");
var ctl, cmode, clength, getCLength, color, img; var ctl, cmode, clength, getCLength, color, img;
//Util.Debug(" FBU.rects: " + FBU.rects); //Util.Debug(" FBU.rects: " + FBU.rects);
//Util.Debug(" RQlen(): " + RQlen()); //Util.Debug(" starting RQ.slice(RQi,RQi+20): " + RQ.slice(RQi,RQi+20) + " (" + RQlen() + ")");
//Util.Debug(" RQ.slice(0,20): " + RQ.slice(0,20));
FBU.bytes = 1; // compression-control byte FBU.bytes = 1; // compression-control byte
if (RQlen() < FBU.bytes) { if (RQlen() < FBU.bytes) {
...@@ -1398,13 +1396,13 @@ encHandlers.TIGHT_PNG = function display_tight_png() { ...@@ -1398,13 +1396,13 @@ encHandlers.TIGHT_PNG = function display_tight_png() {
// Determine FBU.bytes // Determine FBU.bytes
switch (cmode) { switch (cmode) {
case "fill": case "fill":
RQ[RQi++]; // shift off ctl RQi++; // shift off ctl
color = RQshiftBytes(fb_depth); color = RQshiftBytes(fb_depth);
canvas.fillRect(FBU.x, FBU.y, FBU.width, FBU.height, color); canvas.fillRect(FBU.x, FBU.y, FBU.width, FBU.height, color);
break; break;
case "jpeg": case "jpeg":
case "png": case "png":
clength = getCLength(RQ, 1); clength = getCLength(RQ, RQi+1);
FBU.bytes = 1 + clength[0] + clength[1]; // ctl + clength size + jpeg-data FBU.bytes = 1 + clength[0] + clength[1]; // ctl + clength size + jpeg-data
if (RQlen() < FBU.bytes) { if (RQlen() < FBU.bytes) {
Util.Debug(" waiting for TIGHT " + cmode + " bytes"); Util.Debug(" waiting for TIGHT " + cmode + " bytes");
...@@ -1424,8 +1422,7 @@ encHandlers.TIGHT_PNG = function display_tight_png() { ...@@ -1424,8 +1422,7 @@ encHandlers.TIGHT_PNG = function display_tight_png() {
} }
FBU.bytes = 0; FBU.bytes = 0;
FBU.rects -= 1; FBU.rects -= 1;
//Util.Debug(" ending RQlen(): " + RQlen()); //Util.Debug(" ending RQ.slice(RQi,RQi+20): " + RQ.slice(RQi,RQi+20) + " (" + RQlen() + ")");
//Util.Debug(" ending RQ.slice(0,20): " + RQ.slice(0,20));
//Util.Debug("<< display_tight_png"); //Util.Debug("<< display_tight_png");
return true; return true;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment