forked from enlightenment/efl
evas-gl-common: Fix dereference after null check
Coverity reports that there may be a null pointer dereference here so check that 'error' exists before trying to set it. Fixes CID1374272 @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
81d76776be
commit
cec6793db4
|
@ -243,7 +243,7 @@ evas_gl_common_image_new_from_rgbaimage(Evas_Engine_GL_Context *gc, RGBA_Image *
|
||||||
((int)im_im->cache_entry.h > gc->shared->info.max_texture_size))
|
((int)im_im->cache_entry.h > gc->shared->info.max_texture_size))
|
||||||
{
|
{
|
||||||
evas_cache_image_drop(&(im_im->cache_entry));
|
evas_cache_image_drop(&(im_im->cache_entry));
|
||||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
if (error) *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -259,7 +259,7 @@ evas_gl_common_image_new_from_rgbaimage(Evas_Engine_GL_Context *gc, RGBA_Image *
|
||||||
gc->shared->images = eina_list_remove_list(gc->shared->images, l);
|
gc->shared->images = eina_list_remove_list(gc->shared->images, l);
|
||||||
gc->shared->images = eina_list_prepend(gc->shared->images, im);
|
gc->shared->images = eina_list_prepend(gc->shared->images, im);
|
||||||
evas_gl_common_image_ref(im);
|
evas_gl_common_image_ref(im);
|
||||||
*error = EVAS_LOAD_ERROR_NONE;
|
if (error) *error = EVAS_LOAD_ERROR_NONE;
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ evas_gl_common_image_new_from_rgbaimage(Evas_Engine_GL_Context *gc, RGBA_Image *
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
evas_cache_image_drop(&(im_im->cache_entry));
|
evas_cache_image_drop(&(im_im->cache_entry));
|
||||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
if (error) *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (im_im->cache_entry.cspaces)
|
if (im_im->cache_entry.cspaces)
|
||||||
|
|
Loading…
Reference in New Issue