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>
dev
Ustun Ergenoglu 13 years ago committed by Kristian Høgsberg
parent 5ab91ad845
commit 6dc0f86dbd
  1. 4
      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);

Loading…
Cancel
Save