evas: Fix unlikely crash with image cache
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 1 Sep 2016 02:17:08 +0000 (11:17 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 1 Sep 2016 02:57:43 +0000 (11:57 +0900)
This happened to me when running elm_suite manually, during
elm_shutdown. At this point, cache shouldn't be null, but better
be safe anyway.

src/lib/evas/cache/evas_cache_image.c

index 21edc94..a0c6a65 100644 (file)
@@ -250,6 +250,12 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache,
 {
    Image_Entry  *ie;
 
+   if (!cache)
+     {
+        *error = EVAS_LOAD_ERROR_GENERIC;
+        return NULL;
+     }
+
    ie = cache->func.alloc();
    if (!ie)
      {