From 20a4ecf175236f9ba2a6a3b83bdb239e3e85c89a Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 16 Jan 2013 06:10:09 +0100 Subject: [PATCH] Added missing WGL pixel format error check. --- src/wgl_context.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wgl_context.c b/src/wgl_context.c index a802d9a9..2284f3d1 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -293,6 +293,12 @@ int _glfwCreateContext(_GLFWwindow* window, pfd.cAuxBuffers = fbconfig->auxBuffers; pixelFormat = ChoosePixelFormat(window->wgl.dc, &pfd); + if (!pixelFormat) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "WGL: Failed to find a suitable pixel format"); + return GL_FALSE; + } } if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))