diff options
author | Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | 2017-04-24 16:10:28 +0200 |
---|---|---|
committer | Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | 2017-04-24 17:22:37 +0200 |
commit | 106eae7aad23dffcefe11ec3bf86e54e35137689 (patch) | |
tree | bc430cf95d348630511e272e0a104410971e5372 /src/dispatch_common.c | |
parent | 5b6d99069b3fa0d4e12ee617b144a51312bcea79 (diff) | |
download | libepoxy-106eae7aad23dffcefe11ec3bf86e54e35137689.tar.gz |
epoxy_internal_has_gl_extension, epoxy_egl_version: add some missing nullpointer checks from https://bugzilla.redhat.com/show_bug.cgi?id=1395366
Related commit: b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc
Fix "epoxy_glx_version" to handle the case when GLX is not active on the display.
Patch is tweak from the original version posted by Tom Horsley
Diffstat (limited to 'src/dispatch_common.c')
-rw-r--r-- | src/dispatch_common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dispatch_common.c b/src/dispatch_common.c index b521b1b..a38c0fc 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -443,7 +443,12 @@ bool epoxy_extension_in_string(const char *extension_list, const char *ext) { const char *ptr = extension_list; - int len = strlen(ext); + int len; + + if (!ext) + return false; + + len = strlen(ext); if (extension_list == NULL || *extension_list == '\0') return false; @@ -478,6 +483,8 @@ epoxy_internal_has_gl_extension(const char *ext, bool invalid_op_mode) for (i = 0; i < num_extensions; i++) { const char *gl_ext = (const char *)glGetStringi(GL_EXTENSIONS, i); + if (!gl_ext) + return false; if (strcmp(ext, gl_ext) == 0) return true; } |