From 28055e28973785d867595d81e40c175843186751 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 23 Feb 2017 13:12:54 +0100 Subject: [PATCH] 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. --- common/rfb/Cursor.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.5