summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-06-15 14:09:33 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-07-02 17:20:46 -0400
commitc6c5dd6313625210c9986f053f58c3c2fc768a12 (patch)
tree6983a667dc17b04a2c87d321d52918e4fdb8d7fa
parentf8f6231ecdb99595a07e6c3933dedd7438ef4f1d (diff)
canvas_utils: Make sure strides are aligned to multiple of 4
Pixman requires all strides to be aligned to a multiple of 4. With the upcoming a8 images, this is not guaranteed anymore.
-rw-r--r--common/canvas_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 7b92436..feb89cb 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -282,6 +282,9 @@ pixman_image_t *alloc_lz_image_surface(LzDecodeUsrData *canvas_data,
stride = (gross_pixels / height) * (PIXMAN_FORMAT_BPP (pixman_format) / 8);
+ /* pixman requires strides to be 4-byte aligned */
+ stride = SPICE_ALIGN(stride, 4);
+
if (!top_down) {
stride = -stride;
}