From 301cf7b26751ff7e19f59ff871f6b54ff339d040 Mon Sep 17 00:00:00 2001 From: "P. F. Chimento" Date: Thu, 4 Aug 2011 20:23:49 +0200 Subject: [PATCH] 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. --- libchimara/graphics.c | 3 +++ 1 file changed, 3 insertions(+) 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(); -- 2.30.2