Fix null pointer dereference
Add null check for return values of _glfwPlatformGetTls().
This commit is contained in:
parent
535680668b
commit
daeacc134f
2
src/external/glfw/src/egl_context.c
vendored
2
src/external/glfw/src/egl_context.c
vendored
|
|
@ -279,7 +279,7 @@ static GLFWglproc getProcAddressEGL(const char* procname)
|
|||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
|
||||
if (window->context.egl.client)
|
||||
if (window && window->context.egl.client)
|
||||
{
|
||||
GLFWglproc proc = (GLFWglproc)
|
||||
_glfwPlatformGetModuleSymbol(window->context.egl.client, procname);
|
||||
|
|
|
|||
5
src/external/glfw/src/glx_context.c
vendored
5
src/external/glfw/src/glx_context.c
vendored
|
|
@ -189,14 +189,15 @@ static void swapBuffersGLX(_GLFWwindow* window)
|
|||
|
||||
static void swapIntervalGLX(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
|
||||
if (_glfw.glx.EXT_swap_control)
|
||||
{
|
||||
_GLFWwindow *window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
if (window) {
|
||||
_glfw.glx.SwapIntervalEXT(_glfw.x11.display,
|
||||
window->context.glx.window,
|
||||
interval);
|
||||
}
|
||||
}
|
||||
else if (_glfw.glx.MESA_swap_control)
|
||||
_glfw.glx.SwapIntervalMESA(interval);
|
||||
else if (_glfw.glx.SGI_swap_control)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user