From f6c7fcc2f3d907c64b577d2e20277fe3f9c4175e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 14 2018 13:03:03 +0000 Subject: import libepoxy-1.3.1-2.el7_5 --- diff --git a/SOURCES/libepoxy-handle-lack-of-GLX.patch b/SOURCES/libepoxy-handle-lack-of-GLX.patch new file mode 100644 index 0000000..57d1c75 --- /dev/null +++ b/SOURCES/libepoxy-handle-lack-of-GLX.patch @@ -0,0 +1,106 @@ +From 31a1fd9d6dcf298b7ed61ac06d54e6f9cd2dee03 Mon Sep 17 00:00:00 2001 +From: Yaron Cohen-Tal +Date: Fri, 29 Jul 2016 17:55:49 +0300 +Subject: [PATCH 1/3] Check for NULL extensions string + +Some X server not supporting any OpenGL feature, glXQueryExtensionsString +will return NULL and causes the function to fail. + +Thanks to Emmanuel Stapf (manus@eiffel.com) for the original patch. + +This was verified running an application on macOS while the X server was +running on Windows Xming 7.5.0.10 + +Signed-off-by: Emmanuele Bassi +--- + src/dispatch_common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/dispatch_common.c b/src/dispatch_common.c +index 013027f85bd5..ba6fca373d76 100644 +--- a/src/dispatch_common.c ++++ b/src/dispatch_common.c +@@ -347,6 +347,8 @@ epoxy_conservative_gl_version(void) + bool + epoxy_extension_in_string(const char *extension_list, const char *ext) + { ++ if (!extension_list) ++ return false; + const char *ptr = extension_list; + int len = strlen(ext); + +-- +2.14.3 + + +From 7a1a79ec3b68857f8a0b1d26811fec2d00ea4fb2 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Wed, 7 Dec 2016 15:12:15 +0000 +Subject: [PATCH 2/3] Avoid C99 declaration after statement + +The rest of the library is C89-only, so we should keep it that way. +--- + src/dispatch_common.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/dispatch_common.c b/src/dispatch_common.c +index ba6fca373d76..4f58be2caed2 100644 +--- a/src/dispatch_common.c ++++ b/src/dispatch_common.c +@@ -347,11 +347,12 @@ epoxy_conservative_gl_version(void) + bool + epoxy_extension_in_string(const char *extension_list, const char *ext) + { +- if (!extension_list) +- return false; + const char *ptr = extension_list; + int len = strlen(ext); + ++ if (extension_list == NULL || *extension_list == '\0') ++ return false; ++ + /* Make sure that don't just find an extension with our name as a prefix. */ + while (true) { + ptr = strstr(ptr, ext); +-- +2.14.3 + + +From 40d724e11ea37a4177bbb04fbe954c840c8e102d Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Mon, 12 Dec 2016 14:18:15 +0000 +Subject: [PATCH 3/3] Ensure we don't assert if GLX is not available + +Certain X server do not have GLX enabled or supported, such as x2go. We +can handle this case gracefully inside libepoxy. + +Signed-off-by: Emmanuele Bassi +--- + src/dispatch_glx.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/dispatch_glx.c b/src/dispatch_glx.c +index 78e61c24a761..9e4cef62c86a 100644 +--- a/src/dispatch_glx.c ++++ b/src/dispatch_glx.c +@@ -57,11 +57,17 @@ epoxy_glx_version(Display *dpy, int screen) + int ret; + + version_string = glXQueryServerString(dpy, screen, GLX_VERSION); ++ if (!version_string) ++ return 0; ++ + ret = sscanf(version_string, "%d.%d", &server_major, &server_minor); + assert(ret == 2); + server = server_major * 10 + server_minor; + + version_string = glXGetClientString(dpy, GLX_VERSION); ++ if (!version_string) ++ return 0; ++ + ret = sscanf(version_string, "%d.%d", &client_major, &client_minor); + assert(ret == 2); + client = client_major * 10 + client_minor; +-- +2.14.3 + diff --git a/SPECS/libepoxy.spec b/SPECS/libepoxy.spec index 3acf2b1..34c2c88 100644 --- a/SPECS/libepoxy.spec +++ b/SPECS/libepoxy.spec @@ -6,7 +6,7 @@ Summary: epoxy runtime library Name: libepoxy Version: 1.3.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://github.com/anholt/libepoxy # github url - generated archive @@ -16,6 +16,9 @@ Source0: https://github.com/anholt/libepoxy/archive/v%{version}/v%{version}.tar. Patch0: 0001-test-Fix-dlwrap-on-ppc64-and-s390x.patch Patch1: 0001-Fix-ppc64le-and-arm64.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1566101 +Patch2: libepoxy-handle-lack-of-GLX.patch + BuildRequires: automake autoconf libtool BuildRequires: mesa-libGL-devel BuildRequires: mesa-libEGL-devel @@ -38,6 +41,7 @@ developing applications that use %{name}. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build autoreconf -vif || exit 1 @@ -70,6 +74,10 @@ make check # || ( cat test/test-suite.log ; objdump -T %{_libdir}/libdl.so.? ) %{_libdir}/pkgconfig/epoxy.pc %changelog +* Wed Apr 11 2018 Debarshi Ray - 1.3.1-2 +- Prevent crash in epoxy_glx_version if GLX is not available +Resolves: #1566101 + * Fri Jan 27 2017 Adam Jackson - 1.3.1-1 - libepoxy 1.3.1