Changes outside the framebuffer can sometimes be reported so we need to
make sure that we can deal with them gracefully.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3834 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/ComparingUpdateTracker.cxx b/common/rfb/ComparingUpdateTracker.cxx
index 40f5142..cd579a8 100644
--- a/common/rfb/ComparingUpdateTracker.cxx
+++ b/common/rfb/ComparingUpdateTracker.cxx
@@ -73,7 +73,11 @@
void ComparingUpdateTracker::compareRect(const Rect& r, Region* newChanged)
{
if (!r.enclosed_by(fb->getRect())) {
- fprintf(stderr,"ComparingUpdateTracker: rect outside fb (%d,%d-%d,%d)\n", r.tl.x, r.tl.y, r.br.x, r.br.y);
+ Rect safe;
+ // Crop the rect and try again
+ safe = r.intersect(fb->getRect());
+ if (!safe.is_empty())
+ compareRect(safe, newChanged);
return;
}