projects
/
profile
/
ivi
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8801357
)
image: Don't segfault when the file doesn't exist
author
Juan Zhao
<juan.j.zhao@linux.intel.com>
Tue, 7 Aug 2012 02:45:43 +0000
(19:45 -0700)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Thu, 9 Aug 2012 14:55:40 +0000
(10:55 -0400)
Don't create a window when the file doesn't exist.
https://bugs.freedesktop.org/show_bug.cgi?id=52450
clients/image.c
patch
|
blob
|
history
diff --git
a/clients/image.c
b/clients/image.c
index
711f0d8
..
c289d76
100644
(file)
--- a/
clients/image.c
+++ b/
clients/image.c
@@
-130,6
+130,12
@@
image_create(struct display *display, const char *filename)
image->filename = strdup(filename);
image->image = load_cairo_surface(filename);
+
+ if (!image->image) {
+ fprintf(stderr, "could not find the image %s!\n", b);
+ return NULL;
+ }
+
image->window = window_create(display);
image->widget = frame_create(image->window, image);
window_set_title(image->window, title);