aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2017-02-23 13:12:54 +0100
committerPierre Ossman <ossman@cendio.se>2017-02-23 13:12:54 +0100
commit28055e28973785d867595d81e40c175843186751 (patch)
treee36d154599eea2a7cd381c0d3370e7620edc438b /common
parente714412294e9955448be2ec98f8f10684476fa8f (diff)
downloadtigervnc-28055e28973785d867595d81e40c175843186751.tar.gz
tigervnc-28055e28973785d867595d81e40c175843186751.zip
Don't try to render cursors with no size
Even if there are no pixels it will still trigger sanity checks when we start throwing bogus coordinates around.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/Cursor.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/rfb/Cursor.cxx b/common/rfb/Cursor.cxx
index ffbe955c..99df82d6 100644
--- a/common/rfb/Cursor.cxx
+++ b/common/rfb/Cursor.cxx
@@ -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);