fa00e1e
From 09b2573e4115f43a09d0c5d529d15b92b2d43d66 Mon Sep 17 00:00:00 2001
f375e62
From: Joel Martin <github@martintribe.org>
f375e62
Date: Wed, 16 May 2012 12:54:25 +0000
f375e62
Subject: [PATCH] ui/vnc: Only report/use TIGHT_PNG encoding if enabled.
f375e62
f375e62
If TIGHT_PNG is not enabled by the --enable-vnc-png configure flag
f375e62
then do not report to the client that it is supported.
f375e62
f375e62
Also, since TIGHT_PNG is the same as the TIGHT encoding but with the
f375e62
filter/copy replaced with PNG data, adding it to the supported
f375e62
encodings list when it is disabled will cause the TIGHT encoding to be
f375e62
used even though the client requested TIGHT_PNG.
f375e62
f375e62
Signed-off-by: Joel Martin <github@martintribe.org>
f375e62
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
f375e62
(cherry picked from commit fe3e7f2dc05225cdd2ba40defcd4e2581bebc5e0)
f375e62
f375e62
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
f375e62
---
f375e62
 ui/vnc.c | 2 ++
f375e62
 1 file changed, 2 insertions(+)
f375e62
f375e62
diff --git a/ui/vnc.c b/ui/vnc.c
f375e62
index 01b2daf..18ec101 100644
f375e62
--- a/ui/vnc.c
f375e62
+++ b/ui/vnc.c
f375e62
@@ -1802,10 +1802,12 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
f375e62
             vs->features |= VNC_FEATURE_TIGHT_MASK;
f375e62
             vs->vnc_encoding = enc;
f375e62
             break;
f375e62
+#ifdef CONFIG_VNC_PNG
f375e62
         case VNC_ENCODING_TIGHT_PNG:
f375e62
             vs->features |= VNC_FEATURE_TIGHT_PNG_MASK;
f375e62
             vs->vnc_encoding = enc;
f375e62
             break;
f375e62
+#endif
f375e62
         case VNC_ENCODING_ZLIB:
f375e62
             vs->features |= VNC_FEATURE_ZLIB_MASK;
f375e62
             vs->vnc_encoding = enc;