summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-08-25 16:44:16 +0200
committerAlexander Larsson <alexl@redhat.com>2010-08-26 09:38:36 +0200
commit96987ebfde951caa7b5a5a64683e9b6385f776ef (patch)
tree00b26b96203aac585e4b154ad1664c07903f2820 /common
parentb9b5f8fd56081587559a4611cf57e86ce0f03964 (diff)
downloadspice-96987ebfde951caa7b5a5a64683e9b6385f776ef.tar.gz
spice-96987ebfde951caa7b5a5a64683e9b6385f776ef.tar.xz
spice-96987ebfde951caa7b5a5a64683e9b6385f776ef.zip
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.
Diffstat (limited to 'common')
-rw-r--r--common/canvas_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 1f6eca67..020b23cc 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;