[Spice-commits] common/canvas_utils.c

Alexander Larsson alexl at kemper.freedesktop.org
Thu Aug 26 00:38:42 PDT 2010


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

New commits:
commit 96987ebfde951caa7b5a5a64683e9b6385f776ef
Author: Alexander Larsson <alexl at redhat.com>
Date:   Wed Aug 25 16:44:16 2010 +0200

    server: Fix alloc_lz_image_surface stride allocations
    
    All lz surfaces are not 4 bytes per pixel, calculate the right stride
    based on the pixman format.

diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 1f6eca6..020b23c 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -290,7 +290,7 @@ pixman_image_t *alloc_lz_image_surface(LzDecodeUsrData *canvas_data,
     int stride;
     pixman_image_t *surface = NULL;
 
-    stride = (gross_pixels / height) * 4;
+    stride = (gross_pixels / height) * (PIXMAN_FORMAT_BPP (pixman_format) / 8);
 
     if (!top_down) {
         stride = -stride;


More information about the Spice-commits mailing list