Skip to content

Handle ZRLE encoding of zero size alpha cursor

Recent RealVNC server version (as found on Raspberry Pi OS) are declaring a ZRLE encoding (unit32 value 16) for zero sized alpha cursors. This makes VNC connections to Raspberry Pi's impossible since a few months (see: connections#73).

This MR fixes this by explicitly handling VNC_CONNECTION_ENCODING_ZRLE also in the "zero size" code path.

I was able to successfully connect via VNC to my Raspberry Pi's with a patched gtk-vnc in a test build of GNOME Connections.

I don't know if reading (and asserting) the length attribute is necessary, but since it belongs to the ZRLE encoding definition according to RFC 6143, I did.

As a matter of fact, the following super (overly?) simple variant of this MR also allows successful VNC connections to Raspberry Pi's:

diff --git a/src/vncconnection.c b/src/vncconnection.c
index 475cfcb..f1dcb49 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -3296,6 +3296,7 @@ static void vnc_connection_alpha_cursor(VncConnection *conn, guint16 x, guint16
         }
         switch (encoding) {
         case VNC_CONNECTION_ENCODING_RAW:
+        case VNC_CONNECTION_ENCODING_ZRLE:
             break;
         default:
             vnc_connection_set_error(conn,

Merge request reports