]> source.dussan.org Git - tigervnc.git/commitdiff
Don't try to render cursors with no size
authorPierre Ossman <ossman@cendio.se>
Thu, 23 Feb 2017 12:12:54 +0000 (13:12 +0100)
committerPierre Ossman <ossman@cendio.se>
Thu, 23 Feb 2017 12:12:54 +0000 (13:12 +0100)
Even if there are no pixels it will still trigger sanity checks
when we start throwing bogus coordinates around.

common/rfb/Cursor.cxx

index ffbe955ca950264039468f4b01b73db43de8e5b2..99df82d6de44312d3f1a27ad4e25d4fe4e2accdd 100644 (file)
@@ -283,6 +283,11 @@ void RenderedCursor::update(PixelBuffer* framebuffer,
   buffer.setPF(format);
   buffer.setSize(clippedRect.width(), clippedRect.height());
 
+  // Bail out early to avoid pestering the framebuffer with
+  // bogus coordinates
+  if (clippedRect.area() == 0)
+    return;
+
   data = framebuffer->getBuffer(buffer.getRect(offset), &stride);
   buffer.imageRect(buffer.getRect(), data, stride);