Return NULL and check for nullity in the only calling function.
Fixes CID 1039461 (Logically dead code)
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 *
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