handle surf alloc failures.

SVN revision: 59524
This commit is contained in:
Carsten Haitzler 2011-05-19 09:28:43 +00:00
parent 3789e32040
commit 59bc413e1f
1 changed files with 20 additions and 0 deletions

View File

@ -594,6 +594,11 @@ read_psd_grey(Image_Entry *ie, PSD_Header *head, FILE * f, int *error)
evas_cache_image_surface_alloc(ie, ie->w, ie->h);
surface = evas_cache_image_pixels(ie);
if (!surface)
{
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
goto cleanup_error;
}
if (!psd_get_data(ie, head, f, surface, compressed, error))
goto cleanup_error;
@ -654,6 +659,11 @@ read_psd_indexed(Image_Entry *ie, PSD_Header *head, FILE * f, int *error)
evas_cache_image_surface_alloc(ie, ie->w, ie->h);
surface = evas_cache_image_pixels(ie);
if (!surface)
{
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
return EINA_FALSE;
}
if (!psd_get_data(ie, head, f, surface, compressed, error))
return EINA_FALSE;
@ -707,6 +717,11 @@ read_psd_rgb(Image_Entry *ie, PSD_Header *head, FILE *f, int *error)
evas_cache_image_surface_alloc(ie, ie->w, ie->h);
surface = evas_cache_image_pixels(ie);
if (!surface)
{
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
goto cleanup_error;
}
if (!psd_get_data(ie, head, f, surface, compressed, error))
goto cleanup_error;
@ -784,6 +799,11 @@ read_psd_cmyk(Image_Entry *ie, PSD_Header *head, FILE *f, int *error)
evas_cache_image_surface_alloc(ie, ie->w, ie->h);
surface = evas_cache_image_pixels(ie);
if (!surface)
{
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
goto cleanup_error;
}
if (!psd_get_data(ie, head, f, surface, compressed, error))
goto cleanup_error;