diff options
author | Minwoo, Lee <minwoo47.lee@samsung.com> | 2016-01-06 11:24:16 -0800 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2016-01-06 13:36:40 -0800 |
commit | 3f5066278ea25e21b80c0f7cf2e5666ad21f3702 (patch) | |
tree | 630f3321f6c3dc0c7525761f3374d6537b365e7f | |
parent | c27fd0fff55dbd29f760f350440cca0ff2bc2e5f (diff) | |
download | efl-3f5066278ea25e21b80c0f7cf2e5666ad21f3702.tar.gz |
evas: fix a NULL dereference issue
Summary:
If evas engine init failed, it can make crash.
For example
If opengl init failed, then ee->prop.window is 0
ecore_evas_gl_x11_options_new_internal
{
if (!ee->prop.window)
{
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
ecore_evas_free(ee);
return NULL;
}
}
ecore_evas_free calls evas_fonts_zero_pressure
and this time evas->engine.func is NULL so it makes crash.
Reviewers: cedric
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3542
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r-- | src/lib/evas/canvas/evas_font_dir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index b54e6c0f41..ffb4423fde 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -148,7 +148,8 @@ evas_fonts_zero_free(Evas *eo_evas) { if (fd->fdesc) evas_font_desc_unref(fd->fdesc); if (fd->source) eina_stringshare_del(fd->source); - evas->engine.func->font_free(evas->engine.data.output, fd->font); + if ((evas->engine.func) && (evas->engine.func->font_free)) + evas->engine.func->font_free(evas->engine.data.output, fd->font); #ifdef HAVE_FONTCONFIG if (fd->set) FcFontSetDestroy(fd->set); if (fd->p_nm) FcPatternDestroy(fd->p_nm); @@ -173,7 +174,8 @@ evas_fonts_zero_pressure(Evas *eo_evas) if (fd->fdesc) evas_font_desc_unref(fd->fdesc); if (fd->source) eina_stringshare_del(fd->source); - evas->engine.func->font_free(evas->engine.data.output, fd->font); + if ((evas->engine.func) && (evas->engine.func->font_free)) + evas->engine.func->font_free(evas->engine.data.output, fd->font); #ifdef HAVE_FONTCONFIG if (fd->set) FcFontSetDestroy(fd->set); if (fd->p_nm) FcPatternDestroy(fd->p_nm); |