diff options
-rwxr-xr-x | src/cairo-evas-gl-context.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cairo-evas-gl-context.c b/src/cairo-evas-gl-context.c index 3805118e7..10d680817 100755 --- a/src/cairo-evas-gl-context.c +++ b/src/cairo-evas-gl-context.c @@ -174,13 +174,15 @@ _cairo_evas_gl_get_proc_addr (void *data, const char *name) api = evas_gl_api_get (gl); - for (i = 0; evas_gl_func_map[i].name; i++) { - if (! strncmp (evas_gl_func_map[i].name, name, strlen(name))) - return *((cairo_gl_generic_func_t *) (((char *) &api->version) + evas_gl_func_map[i].func)); - } - - return evas_gl_proc_address_get (gl, name); -} + if(api != NULL) { + for (i = 0; evas_gl_func_map[i].name; i++) { + if (! strncmp (evas_gl_func_map[i].name, name, strlen(name))) + return *((cairo_gl_generic_func_t *) (((char *) &api->version) + evas_gl_func_map[i].func)); + } + } + + return evas_gl_proc_address_get (gl, name); +} static cairo_bool_t _context_acquisition_changed_evas_gl_state (cairo_evas_gl_context_t *ctx, |