Skip to content

Commit

Permalink
epoxy_internal_has_gl_extension, epoxy_egl_version: add some missing …
Browse files Browse the repository at this point in the history
…nullpointer checks from https://bugzilla.redhat.com/show_bug.cgi?id=1395366

Related commit: b3b8bd9
 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
  • Loading branch information
LocutusOfBorg committed Apr 24, 2017
1 parent 5b6d990 commit e581b15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dispatch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ bool
epoxy_extension_in_string(const char *extension_list, const char *ext)
{
const char *ptr = extension_list;
if (!ext)
return false;

int len = strlen(ext);

if (extension_list == NULL || *extension_list == '\0')
Expand Down Expand Up @@ -478,6 +481,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

0 comments on commit e581b15

Please sign in to comment.