summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoonhee, choi <mh0310.choi@samsung.com>2016-11-22 15:12:55 +0900
committermoonhee, choi <mh0310.choi@samsung.com>2016-11-22 15:16:21 +0900
commit8a4f453c6ae9091976e08944ab646a4b44174dae (patch)
treebb4da09fda3365279bbbff3325591fc7864bc27a
parent34b6b9fa6b0d0c334dabfe30f07bc33a5dcbf5d8 (diff)
downloadcairo-8a4f453c6ae9091976e08944ab646a4b44174dae.tar.gz
cairo-8a4f453c6ae9091976e08944ab646a4b44174dae.tar.bz2
cairo-8a4f453c6ae9091976e08944ab646a4b44174dae.zip
Checking api handle against NULL value before referencing its value. Change-Id: Ia5cca22c7be18843bc6455718b9eca9e51a21347
-rw-r--r--src/cairo-evas-gl-context.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cairo-evas-gl-context.c b/src/cairo-evas-gl-context.c
index 3805118e7..26f1b3be0 100644
--- a/src/cairo-evas-gl-context.c
+++ b/src/cairo-evas-gl-context.c
@@ -174,9 +174,11 @@ _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));
+ 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);