aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vnc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vnc.c b/vnc.c
index 1fb46bd..774a0b3 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1649,6 +1649,11 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
vs->tight_quality = 9;
vs->absolute = -1;
+ /*
+ * Start from the end because the encodings are sent in order of preference.
+ * This way the prefered encoding (first encoding defined in the array)
+ * will be set at the end of the loop.
+ */
for (i = n_encodings - 1; i >= 0; i--) {
enc = encodings[i];
switch (enc) {