From 610a3f29227d43e12a8acedce2b3149d16a60847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 3 Apr 2012 14:49:50 -0400 Subject: [PATCH] window: Check load_image result for NULL --- clients/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/window.c b/clients/window.c index 9f5b837c..5391d641 100644 --- a/clients/window.c +++ b/clients/window.c @@ -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) {