[gtk-vnc] src: correctly handle zero size alpha cursor
- From: Daniel P. Berrange <dberrange src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-vnc] src: correctly handle zero size alpha cursor
- Date: Fri, 11 Dec 2020 18:02:22 +0000 (UTC)
commit a818f5c3444cd3fcd462c45254c4ab78815ce431
Author: Daniel P. Berrangé <dan berrange com>
Date: Fri Dec 11 15:43:31 2020 +0000
src: correctly handle zero size alpha cursor
Even with a zero size cursor we still have to read the encoding type off
the wire. Assuming we get a raw encoding, we don't have any further data
to read.
Signed-off-by: Daniel P. Berrangé <berrange redhat com>
src/vncconnection.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index a2aec30..6d34c5a 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -3208,6 +3208,20 @@ static void vnc_connection_alpha_cursor(VncConnection *conn, guint16 x, guint16
x, y, width, height);
/* pixels is owned by priv->cursor now */
g_object_unref(fb);
+ } else {
+ guint32 encoding = vnc_connection_read_u32(conn);
+ if (vnc_connection_has_error(conn)) {
+ return;
+ }
+ switch (encoding) {
+ case VNC_CONNECTION_ENCODING_RAW:
+ break;
+ default:
+ vnc_connection_set_error(conn,
+ "Unsupported encoding %u for zero size alpha cursor",
+ encoding);
+ break;
+ }
}
sigdata.params.cursor = priv->cursor;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]