From: Alexander Larsson <[email protected]>

All lz surfaces are not 4 bytes per pixel, calculate the right stride
based on the pixman format.
---
 common/canvas_utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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;
-- 
1.7.2.1

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to