Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epoxy_internal_has_gl_extension, epoxy_egl_version: add some missing … #118

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/dispatch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions src/dispatch_egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ epoxy_egl_version(EGLDisplay dpy)
int ret;

version_string = eglQueryString(dpy, EGL_VERSION);
if (!version_string)
return 0;

ret = sscanf(version_string, "%d.%d", &major, &minor);
assert(ret == 2);
return major * 10 + minor;
Expand Down