summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2014-09-22 14:20:31 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-09-22 14:59:27 +0200
commitffb518fcdd7982290cd5e8d1d1b64a6bb4825bfb (patch)
treee064076155acb92a971c36dfe70dbf565d859cd1
parentabb03f76c4a3e3f697ae1813b784ff8fcf1f66a7 (diff)
evas: Gl_Cocoa - fix early segfault caused by unloaded symbols
Summary: evas_gl_symbols() (introduced in commit 9a9d78d) was not dlsym()ed which led to unloaded symbols, so NULL function pointers which were happily dereferenced, leading to an early segfault, and therefore to a broken engine. @fix Reviewers: cedric, raoulh Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1440 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/modules/evas/engines/gl_cocoa/evas_engine.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c
index 1a1eb9b..76bc6d5 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.c
+++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c
@@ -13,6 +13,8 @@ typedef struct _Render_Engine Render_Engine;
13typedef struct _Render_Engine_GL_Surface Render_Engine_GL_Surface; 13typedef struct _Render_Engine_GL_Surface Render_Engine_GL_Surface;
14typedef struct _Render_Engine_GL_Context Render_Engine_GL_Context; 14typedef struct _Render_Engine_GL_Context Render_Engine_GL_Context;
15 15
16Evas_Gl_Symbols glsym_evas_gl_symbols = NULL;
17
16struct _Render_Engine 18struct _Render_Engine
17{ 19{
18 Evas_GL_Cocoa_Window *win; 20 Evas_GL_Cocoa_Window *win;
@@ -1337,6 +1339,12 @@ eng_image_load_error_get(void *data EINA_UNUSED, void *image)
1337 return im->im->cache_entry.load_error; 1339 return im->im->cache_entry.load_error;
1338} 1340}
1339 1341
1342static void *
1343_dlsym(const char *sym)
1344{
1345 return dlsym(RTLD_DEFAULT, sym);
1346}
1347
1340static int 1348static int
1341module_open(Evas_Module *em) 1349module_open(Evas_Module *em)
1342{ 1350{
@@ -1422,6 +1430,12 @@ module_open(Evas_Module *em)
1422 1430
1423 ORD(image_load_error_get); 1431 ORD(image_load_error_get);
1424 1432
1433#define LINK2GENERIC(sym) \
1434 glsym_##sym = dlsym(RTLD_DEFAULT, #sym);
1435
1436 LINK2GENERIC(evas_gl_symbols);
1437 glsym_evas_gl_symbols(_dlsym);
1438
1425 /* now advertise out own api */ 1439 /* now advertise out own api */
1426 em->functions = (void *)(&func); 1440 em->functions = (void *)(&func);
1427 return 1; 1441 return 1;