summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-09-22 20:45:04 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-09-23 11:28:14 +0900
commitef759b63951c0fffb61cf8366c0aff884301b5df (patch)
tree5f0ed37361e96bcf92e0601e0eb4981fc4c925e0
parent63088b583c26e72223d3ff4149706b5380f0c1d4 (diff)
downloadefl-ef759b63951c0fffb61cf8366c0aff884301b5df.tar.gz
evas: Prevent crashes in case of error
SEGV would happen if the cache was NULL, as the error pointer was also NULL in some cases (root cause for cache == NULL not quite known, happens in elm_suite with CK_FORK=no). Note: simply adding evas_common_init() to evas_init() leads to a whole new set of issues with CK_FORK=no elm_suite - not good.
-rw-r--r--src/lib/evas/cache/evas_cache_image.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index a0c6a65fcd..7dba180db8 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -1066,6 +1066,7 @@ evas_cache_image_copied_data(Evas_Cache_Image *cache,
DATA32 *image_data, int alpha,
Evas_Colorspace cspace)
{
+ int err;
Image_Entry *im;
if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) ||
@@ -1073,7 +1074,7 @@ evas_cache_image_copied_data(Evas_Cache_Image *cache,
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
w &= ~0x1;
- im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, &err);
if (!im) return NULL;
im->space = cspace;
im->flags.alpha = alpha;
@@ -1093,6 +1094,7 @@ EAPI Image_Entry *
evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h,
DATA32 *image_data, int alpha, Evas_Colorspace cspace)
{
+ int err;
Image_Entry *im;
if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) ||
@@ -1100,7 +1102,7 @@ evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h,
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
w &= ~0x1;
- im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, &err);
if (!im) return NULL;
im->w = w;
im->h = h;
@@ -1389,9 +1391,10 @@ evas_cache_image_flush(Evas_Cache_Image *cache)
EAPI Image_Entry *
evas_cache_image_empty(Evas_Cache_Image *cache)
{
+ int err;
Image_Entry *im;
- im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL, &err);
if (!im) return NULL;
im->references = 1;
return im;