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>
This commit is contained in:
Ustun Ergenoglu 2012-03-14 22:07:58 +02:00 committed by Kristian Høgsberg
parent 5ab91ad845
commit 6dc0f86dbd

View File

@ -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);