[Spice-commits] common/canvas_base.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Fri Dec 22 18:22:36 UTC 2017


 common/canvas_base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 637621a9b99d2159b83272154b9d725cb7754e04
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Dec 21 15:54:04 2017 +0000

    canvas-base: Fix width computation for palette images
    
    Palette images have padding at the end of each line, so their stride
    can't be inferred from their width as is currently done. This causes a
    wrong calculation of stride_encoded value which causes a wrong stride
    adjustment.
    
    Before commit 5603961ff "fix 16 bpp LZ image decompression", the output
    stride was always computed as "stride = (n_comp_pixels / height) * 4"
    that is assuming 4 bytes for pixel which was wrong for some output
    however computing starting from width was wrong for palette images.
    
    This commit was added to spice-gtk in v0.32~58, which nicely matches the
    "client regression when upgrading from spice-gtk v0.31 to spice-gtk
    v0.33".
    
    This fix bug https://bugzilla.redhat.com/show_bug.cgi?id=1508847.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Tested-by: Philip J. Turmel <philip at turmel.org>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

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;


More information about the Spice-commits mailing list