From 4076002d7fb1335dd5ad3767561f186ca7af3256 Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Fri, 9 Sep 2005 07:19:07 +0000 Subject: [PATCH] Fixed a bug with sending colors for zero-size cursors, in XCursor pseudo-encoding. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@310 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- rfb/SMsgWriterV3.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/rfb/SMsgWriterV3.cxx b/rfb/SMsgWriterV3.cxx index c34f216d..e91e514f 100644 --- a/rfb/SMsgWriterV3.cxx +++ b/rfb/SMsgWriterV3.cxx @@ -100,14 +100,16 @@ void SMsgWriterV3::writeSetXCursor(int width, int height, int hotspotX, // returned from getBitmap, in writeSetCursorCallback. However, we // would then need to undo the conversion from rgb to Pixel that is // done by FakeAllocColor. - os->writeU8(0); - os->writeU8(0); - os->writeU8(0); - os->writeU8(255); - os->writeU8(255); - os->writeU8(255); - os->writeBytes(data, (width+7)/8 * height); - os->writeBytes(mask, (width+7)/8 * height); + if (width * height) { + os->writeU8(0); + os->writeU8(0); + os->writeU8(0); + os->writeU8(255); + os->writeU8(255); + os->writeU8(255); + os->writeBytes(data, (width+7)/8 * height); + os->writeBytes(mask, (width+7)/8 * height); + } } void SMsgWriterV3::writeFramebufferUpdateStart(int nRects) -- 2.39.5