diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-06-15 14:09:33 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-08-13 11:54:04 -0400 |
commit | 0c1b6de4ad1b3e9d6da50979bb259f0acdc2fd2f (patch) | |
tree | 3179c2ea912615a50a77a43abe3e42842fb1f71a | |
parent | c2adbb00dc0b29de0fe297f241fb0efeb4a81510 (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.c | 3 |
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; } |