From: Chris Michael Date: Thu, 5 Oct 2017 13:51:00 +0000 (-0400) Subject: evas-gl-common: Fix dereference after null check X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~2375 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cec6793db4b3bf9838440889d7d774f5f8918d6c;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c index fe8aa5b..ca305cf 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_image.c +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c @@ -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)) { 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; } */ @@ -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_prepend(gc->shared->images, im); evas_gl_common_image_ref(im); - *error = EVAS_LOAD_ERROR_NONE; + if (error) *error = EVAS_LOAD_ERROR_NONE; return im; } } @@ -273,7 +273,7 @@ evas_gl_common_image_new_from_rgbaimage(Evas_Engine_GL_Context *gc, RGBA_Image * else #endif 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; } if (im_im->cache_entry.cspaces)