evas: fix dereference after null check

Summary:
Static analysis tool reports passing a null pointer 'im->gc' to
_evas_gl_image_cache_add which directly dereferences it, so lets
be sure that 'im->gc' is valid before passing it to cache_add

Reviewers: Hermet, jsuya, herb, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11676
This commit is contained in:
Shinwoo Kim 2020-04-10 08:45:22 -04:00 committed by Mike Blumenkrantz
parent 9fd9a3b120
commit 90cc0c465c
1 changed files with 1 additions and 1 deletions

View File

@ -716,7 +716,7 @@ evas_gl_common_image_free(Evas_GL_Image *im)
{
if (!im->cs.no_free) free(im->cs.data);
}
if (im->cached)
if (im->cached && im->gc)
{
if (_evas_gl_image_cache_add(im)) return;
}