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)
This commit is contained in:
Jean-Philippe Andre 2013-10-29 15:12:58 +09:00
parent 44f89bb8ad
commit aa6d4a3756
2 changed files with 12 additions and 7 deletions

View File

@ -1089,15 +1089,13 @@ evas_cache2_image_writable(Image_Entry *im)
evas_cache2_image_pixels(im),
im->flags.alpha, im->space);
if (!im2)
goto on_error;
{
ERR("Could not create a copy of this image (%dx%d)", im->w, im->h);
return NULL;
}
evas_cache2_image_close(im);
return im2;
on_error:
if (im2)
_evas_cache2_image_entry_delete(cache, im2);
return NULL;
}
EAPI Image_Entry *

View File

@ -1087,7 +1087,14 @@ eng_image_data_get(void *data EINA_UNUSED, void *image, int to_write, DATA32 **i
if (err) *err = error;
if (to_write)
im = (RGBA_Image *)evas_cache2_image_writable(&im->cache_entry);
{
im = (RGBA_Image *)evas_cache2_image_writable(&im->cache_entry);
if (!im)
{
*image_data = NULL;
return NULL;
}
}
}
else
#endif