window: Check load_image result for NULL

This commit is contained in:
Kristian Høgsberg 2012-04-03 14:49:50 -04:00
parent 3685c3abf6
commit 610a3f2922

View File

@ -416,6 +416,8 @@ display_create_egl_image_surface_from_file(struct display *display,
struct egl_image_surface_data *data;
image = load_image(filename);
if (image == NULL)
return NULL;
surface = display_create_egl_image_surface(display, 0, rect);
if (surface == NULL) {
@ -562,6 +564,8 @@ display_create_shm_surface_from_file(struct display *display,
int size;
image = load_image(filename);
if (image == NULL)
return NULL;
surface = display_create_shm_surface(display, rect, 0, NULL);
if (surface == NULL) {