summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-surface.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-05-16 23:58:47 +0200
committerBenjamin Otte <otte@redhat.com>2010-05-17 01:16:16 +0200
commit2b771da47a87f86f378314bfe8033874d9444914 (patch)
treeedf2a1f47242f442defaea6aa9ad64c492a46ee9 /src/cairo-xlib-surface.c
parentb768a33a602942825e5ec651ae7bafd6d5fc33ac (diff)
xlib: ensure variable isn't uninitialized
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r--src/cairo-xlib-surface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 3b01fdebb..ebc45b2aa 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1067,6 +1067,8 @@ _draw_image_surface (cairo_xlib_surface_t *surface,
ret = _pixman_format_from_masks (&image_masks, &intermediate_format);
assert (ret);
+ own_data = FALSE;
+
pixman_image = pixman_image_create_bits (intermediate_format,
image->width,
image->height,
@@ -1089,7 +1091,6 @@ _draw_image_surface (cairo_xlib_surface_t *surface,
ximage.bits_per_pixel = image_masks.bpp;
ximage.data = (char *) pixman_image_get_data (pixman_image);
ximage.bytes_per_line = pixman_image_get_stride (pixman_image);
- own_data = FALSE;
ret = XInitImage (&ximage);
assert (ret != 0);
@@ -1135,6 +1136,7 @@ _draw_image_surface (cairo_xlib_surface_t *surface,
ximage.bytes_per_line = stride;
ximage.data = _cairo_malloc_ab (stride, ximage.height);
if (unlikely (ximage.data == NULL)) {
+ own_data = FALSE;
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto BAIL;
}