forked from enlightenment/efl
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:
parent
44f89bb8ad
commit
aa6d4a3756
|
@ -1089,15 +1089,13 @@ evas_cache2_image_writable(Image_Entry *im)
|
||||||
evas_cache2_image_pixels(im),
|
evas_cache2_image_pixels(im),
|
||||||
im->flags.alpha, im->space);
|
im->flags.alpha, im->space);
|
||||||
if (!im2)
|
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);
|
evas_cache2_image_close(im);
|
||||||
return im2;
|
return im2;
|
||||||
|
|
||||||
on_error:
|
|
||||||
if (im2)
|
|
||||||
_evas_cache2_image_entry_delete(cache, im2);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Image_Entry *
|
EAPI Image_Entry *
|
||||||
|
|
|
@ -1087,7 +1087,14 @@ eng_image_data_get(void *data EINA_UNUSED, void *image, int to_write, DATA32 **i
|
||||||
if (err) *err = error;
|
if (err) *err = error;
|
||||||
|
|
||||||
if (to_write)
|
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
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue