]> source.dussan.org Git - tigervnc.git/commitdiff
Fixed a bug with sending colors for zero-size cursors, in XCursor
authorConstantin Kaplinsky <const@tightvnc.com>
Fri, 9 Sep 2005 07:19:07 +0000 (07:19 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Fri, 9 Sep 2005 07:19:07 +0000 (07:19 +0000)
pseudo-encoding.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@310 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfb/SMsgWriterV3.cxx

index c34f216da3f6a2b07b72a6844e017ee4d3008b1d..e91e514f4ec3acd7ce0276917a41b9b6b61f391a 100644 (file)
@@ -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)