[Spice-devel] [PATCH spice-common] canvas-base: Fix width computation for palette images

Frediano Ziglio fziglio at redhat.com
Thu Dec 21 15:59:27 UTC 2017


Palette images are encoded with a slightly larger pixel than
width. This cause a wrong calculation of stride_encoded value
which cause a wrong stride adjustment.

This fix bug https://bugzilla.redhat.com/show_bug.cgi?id=1508847.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 common/canvas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index a9d7855..2ecd276 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -824,7 +824,7 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, SpiceImage *image,
     lz_decode_begin(lz_data->lz, comp_buf, comp_size, &type,
                     &width, &height, &n_comp_pixels, &top_down, palette);
 
-    stride_encoded = width;
+    stride_encoded = n_comp_pixels / height;
     switch (type) {
     case LZ_IMAGE_TYPE_RGBA:
         as_type = LZ_IMAGE_TYPE_RGBA;
-- 
2.14.3



More information about the Spice-devel mailing list