From 698d0e471aed6ada0530e84f4e2edcef0af4e39a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 25 Aug 2010 16:44:16 +0200 Subject: [PATCH] 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. --- canvas_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canvas_utils.c b/canvas_utils.c index 1f6eca6..020b23c 100644 --- a/canvas_utils.c +++ b/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;