Patchwork [2/3] vnc: tight: don't forget the third color

login
register
mail settings
Submitter Corentin Chary
Date June 1, 2010, 9:05 p.m.
Message ID <1275426344-26549-3-git-send-email-corentincj@iksaif.net>
Download mbox | patch
Permalink /patch/54314/
State New
Headers show

Comments

Corentin Chary - June 1, 2010, 9:05 p.m.
While couting color, if the third color was only present one
time it wasn't added to the palette.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 vnc-encoding-tight.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/vnc-encoding-tight.c b/vnc-encoding-tight.c
index c8effe6..efb57e7 100644
--- a/vnc-encoding-tight.c
+++ b/vnc-encoding-tight.c
@@ -177,6 +177,7 @@  static int tight_palette_insert(QDict *palette, uint32_t rgb, int bpp, int max)
         *palette = qdict_new();                                         \
         tight_palette_insert(*palette, c0, bpp, max);                   \
         tight_palette_insert(*palette, c1, bpp, max);                   \
+        tight_palette_insert(*palette, ci, bpp, max);                   \
                                                                         \
         for (i++; i < count; i++) {                                     \
             if (data[i] == ci) {                                        \