summaryrefslogtreecommitdiff
path: root/src/x11/iconcache.c
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2015-01-12 21:26:27 +0100
committerRui Matos <tiagomatos@gmail.com>2015-01-13 16:01:13 +0100
commit6609d9c6a413ba1c5c005b663d737acf49b40780 (patch)
treec19f67603c3a62d6219644fb934515431c26dd2f /src/x11/iconcache.c
parent73c4342580d002d8acd6355f68003fdcb875e19b (diff)
downloadmutter-6609d9c6a413ba1c5c005b663d737acf49b40780.tar.gz
iconcache: Fix icon data copy into cairo surface
The stride is in bytes but we're copying ints. https://bugzilla.gnome.org/show_bug.cgi?id=742825
Diffstat (limited to 'src/x11/iconcache.c')
-rw-r--r--src/x11/iconcache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/x11/iconcache.c b/src/x11/iconcache.c
index 932af7b19..b205ab6c3 100644
--- a/src/x11/iconcache.c
+++ b/src/x11/iconcache.c
@@ -163,18 +163,18 @@ argbdata_to_surface (gulong *argb_data, int w, int h)
{
cairo_surface_t *surface;
int y, x, stride;
- uint8_t *data;
+ uint32_t *data;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
- stride = cairo_image_surface_get_stride (surface);
- data = cairo_image_surface_get_data (surface);
+ stride = cairo_image_surface_get_stride (surface) / sizeof (uint32_t);
+ data = (uint32_t *) cairo_image_surface_get_data (surface);
/* One could speed this up a lot. */
for (y = 0; y < h; y++)
{
for (x = 0; x < w; x++)
{
- uint32_t *p = (uint32_t *) &data[y * stride + x];
+ uint32_t *p = &data[y * stride + x];
gulong *d = &argb_data[y * w + x];
*p = *d;
}