Correction for graphics problem when using RENDER: Sometimes,
horizontal bands of distorted pixel data is displayed. This has only
been observed in the GNOME environment, and seems to be caused by
vncHooksComposite being called with a negative xDst argument. The fix
is simple: When this happens, return.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@281 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/xc/programs/Xserver/vnc/vncHooks.cc b/xc/programs/Xserver/vnc/vncHooks.cc
index 1321bf3..c0880d9 100644
--- a/xc/programs/Xserver/vnc/vncHooks.cc
+++ b/xc/programs/Xserver/vnc/vncHooks.cc
@@ -505,6 +505,14 @@
   BoxRec box;
   PictureScreenPtr ps = GetPictureScreen(pScreen);
 
+  // For some reason, this hook is sometimes called with a negative
+  // xDst. This causes graphics errors, as well as error messages of
+  // the type:
+  // ComparingUpdateTracker: rect outside fb (-47,76-171,89)
+  // I've never observed a negative yDst, but let's check it anyway. 
+  if ((xDst < 0) || (yDst < 0))
+      return;
+
   box.x1 = pDst->pDrawable->x + xDst;
   box.y1 = pDst->pDrawable->y + yDst;
   box.x2 = box.x1 + width;