vnc: tight: don't forget do at the last color
authorCorentin Chary <corentincj@iksaif.net>
Wed, 7 Jul 2010 18:57:54 +0000 (20:57 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 26 Jul 2010 22:36:14 +0000 (17:36 -0500)
While using indexed colors, the last color was never added to the palette.
Triggered with ubuntu livecd.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ui/vnc-enc-tight.c

index 358221dc061ed12c8bd44ffb940292ad3b1bfeb1..ade8e5f846f519eff4dde50e8c698f4aa78c20be 100644 (file)
@@ -393,11 +393,11 @@ static int tight_palette_insert(QDict *palette, uint32_t rgb, int bpp, int max)
             if (data[i] == ci) {                                        \
                 continue;                                               \
             } else {                                                    \
+                ci = data[i];                                           \
                 if (!tight_palette_insert(*palette, (uint32_t)ci,       \
                                           bpp, max)) {                  \
                     return 0;                                           \
                 }                                                       \
-                ci = data[i];                                           \
             }                                                           \
         }                                                               \
                                                                         \