Patchwork [1/6] ui/vnc: Only report/use TIGHT_PNG encoding if enabled.

login
register
mail settings
Submitter Stefan Hajnoczi
Date Nov. 1, 2012, 7:05 p.m.
Message ID <1351796754-21703-3-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/196375/
State New
Headers show

Comments

Stefan Hajnoczi - Nov. 1, 2012, 7:05 p.m.
From: Joel Martin <github@martintribe.org>

If TIGHT_PNG is not enabled by the --enable-vnc-png configure flag
then do not report to the client that it is supported.

Also, since TIGHT_PNG is the same as the TIGHT encoding but with the
filter/copy replaced with PNG data, adding it to the supported
encodings list when it is disabled will cause the TIGHT encoding to be
used even though the client requested TIGHT_PNG.

Signed-off-by: Joel Martin <github@martintribe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 ui/vnc.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/ui/vnc.c b/ui/vnc.c
index 33e6386..66ae930 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1806,10 +1806,12 @@  static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
             vs->features |= VNC_FEATURE_TIGHT_MASK;
             vs->vnc_encoding = enc;
             break;
+#ifdef CONFIG_VNC_PNG
         case VNC_ENCODING_TIGHT_PNG:
             vs->features |= VNC_FEATURE_TIGHT_PNG_MASK;
             vs->vnc_encoding = enc;
             break;
+#endif
         case VNC_ENCODING_ZLIB:
             vs->features |= VNC_FEATURE_ZLIB_MASK;
             vs->vnc_encoding = enc;