devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7b7161ea13d7d33c6183107a4da5203eddf74217

commit 7b7161ea13d7d33c6183107a4da5203eddf74217
Author: Chris Michael <[email protected]>
Date:   Thu Oct 5 09:54:03 2017 -0400

    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 <[email protected]>
---
 src/modules/evas/engines/gl_common/evas_gl_image.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 ca305cf748..f4ea8e1055 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -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);
 

-- 


Reply via email to