summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2004-06-15 12:23:57 +0000
committerdscho <dscho>2004-06-15 12:23:57 +0000
commit6bda09f03c8d45e205227afdb064d61aa9a918ee (patch)
tree19b336b9f663c983b0e890da0e427ebc5b7660eb
parentd1975049162df0e1e4dcb36a0ac470b08df9cec8 (diff)
downloadlibtdevnc-6bda09f03c8d45e205227afdb064d61aa9a918ee.tar.gz
libtdevnc-6bda09f03c8d45e205227afdb064d61aa9a918ee.zip
fix CoRRE with maxRectsPerUpdate bug
-rw-r--r--libvncserver/rfbserver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 4fe2605..aa6befc 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -1221,8 +1221,9 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
int y = rect.y1;
int w = rect.x2 - x;
int h = rect.y2 - y;
- nUpdateRegionRects += (((w-1) / cl->correMaxWidth + 1)
- * ((h-1) / cl->correMaxHeight + 1));
+ int rectsPerRow = (w-1)/cl->correMaxWidth+1;
+ int rows = (h-1)/cl->correMaxHeight+1;
+ nUpdateRegionRects += rectsPerRow*rows;
}
sraRgnReleaseIterator(i);
#ifdef LIBVNCSERVER_HAVE_LIBZ
@@ -1266,6 +1267,7 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* Tight encoding counts the rectangles differently */
&& cl->preferredEncoding != rfbEncodingTight
+ && cl->preferredEncoding != rfbEncodingCoRRE
#endif
&& nUpdateRegionRects>cl->screen->maxRectsPerUpdate) {
sraRegion* newUpdateRegion = sraRgnBBox(updateRegion);