summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-10-29 15:12:58 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-29 15:12:58 +0900
commitaa6d4a3756b8f173d091ccf9f5751b910d6a6b62 (patch)
tree22bab4181d50456069e0c51fb093ec528fe7890a /src
parent44f89bb8ade404604867fd270d53a3952ba513df (diff)
evas/cserve2: Fix error path in evas_cache2_image_writable()
Return NULL and check for nullity in the only calling function. Fixes CID 1039461 (Logically dead code)
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/cache2/evas_cache2.c10
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c9
2 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index 35cceb6e65..d4b2b5353b 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -1089,15 +1089,13 @@ evas_cache2_image_writable(Image_Entry *im)
1089 evas_cache2_image_pixels(im), 1089 evas_cache2_image_pixels(im),
1090 im->flags.alpha, im->space); 1090 im->flags.alpha, im->space);
1091 if (!im2) 1091 if (!im2)
1092 goto on_error; 1092 {
1093 ERR("Could not create a copy of this image (%dx%d)", im->w, im->h);
1094 return NULL;
1095 }
1093 1096
1094 evas_cache2_image_close(im); 1097 evas_cache2_image_close(im);
1095 return im2; 1098 return im2;
1096
1097on_error:
1098 if (im2)
1099 _evas_cache2_image_entry_delete(cache, im2);
1100 return NULL;
1101} 1099}
1102 1100
1103EAPI Image_Entry * 1101EAPI Image_Entry *
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 57766ef34c..b3ab2ce6bc 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1087,7 +1087,14 @@ eng_image_data_get(void *data EINA_UNUSED, void *image, int to_write, DATA32 **i
1087 if (err) *err = error; 1087 if (err) *err = error;
1088 1088
1089 if (to_write) 1089 if (to_write)
1090 im = (RGBA_Image *)evas_cache2_image_writable(&im->cache_entry); 1090 {
1091 im = (RGBA_Image *)evas_cache2_image_writable(&im->cache_entry);
1092 if (!im)
1093 {
1094 *image_data = NULL;
1095 return NULL;
1096 }
1097 }
1091 } 1098 }
1092 else 1099 else
1093#endif 1100#endif