summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUstun Ergenoglu <ego@ustun.fi>2012-03-14 22:07:58 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-03-20 22:43:55 -0400
commit6dc0f86dbd53ffc064361ab07b6cee696f61f25f (patch)
treebb1c7d92986e6e54f330363e62f676ecce62797a
parent5ab91ad8450004bbb425c784a6fb5cd62beab509 (diff)
cairo-util: load_cairo_surface returns NULL if loading the file fails.
Otherwise a non-existent file in the configuration crashes the desktop shell. Signed-off-by: Ustun Ergenoglu <ego@ustun.fi>
-rw-r--r--clients/cairo-util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/clients/cairo-util.c b/clients/cairo-util.c
index 1f8d307..6d5794b 100644
--- a/clients/cairo-util.c
+++ b/clients/cairo-util.c
@@ -300,6 +300,10 @@ load_cairo_surface(const char *filename)
void *data;
image = load_image(filename);
+ if (image == NULL) {
+ return NULL;
+ }
+
data = pixman_image_get_data(image);
width = pixman_image_get_width(image);
height = pixman_image_get_height(image);