From: Pierre Ossman Date: Thu, 23 Feb 2017 12:12:54 +0000 (+0100) Subject: Don't try to render cursors with no size X-Git-Tag: v1.7.90~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=28055e28973785d867595d81e40c175843186751;p=tigervnc.git 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. --- 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);