evas-gl-image: Fix dereference after null check

Coverity reports passing a null pointer 'im->gc' to
evas_gl_common_context_flush which directly dereferences it, so lets
be sure that 'im->gc' is valid before passing it to context_flush

Fixes CID1374273

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-10-05 09:54:03 -04:00
parent cec6793db4
commit 7b7161ea13
1 changed files with 3 additions and 2 deletions

View File

@ -766,7 +766,7 @@ evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc)
EAPI void
evas_gl_common_image_free(Evas_GL_Image *im)
{
if (!im) return ;
if (!im) return;
im->references--;
if (im->references > 0) return;
@ -781,7 +781,8 @@ evas_gl_common_image_free(Evas_GL_Image *im)
im->fglyph->ext_dat_free = NULL;
}
evas_gl_common_context_flush(im->gc);
if (im->gc)
evas_gl_common_context_flush(im->gc);
evas_gl_common_image_preload_unwatch(im);