From: P. F. Chimento Date: Thu, 4 Aug 2011 18:23:49 +0000 (+0200) Subject: Check if image exists before caching it X-Git-Tag: v0.9~63 X-Git-Url: https://git.stderr.nl/gitweb?p=projects%2Fchimara%2Fchimara.git;a=commitdiff_plain;h=301cf7b26751ff7e19f59ff871f6b54ff339d040 Check if image exists before caching it If a resource load callback returns an invalid file name, for example, then the image operation should be aborted. --- diff --git a/libchimara/graphics.c b/libchimara/graphics.c index afe3e76..0c3215a 100644 --- a/libchimara/graphics.c +++ b/libchimara/graphics.c @@ -123,6 +123,9 @@ load_image_in_cache(glui32 image, gint width, gint height) info = load_image_from_blorb(resource, image, width, height); } + if(info == NULL) + return NULL; + /* Store the image in the cache */ gdk_threads_enter();