SDL_windowsopengl.c: WGL: Fixed null-pointer dereference crash

Fixes #8968

Fixed crash after https://github.com/libsdl-org/SDL/commit/594a79c2f9db21a11a76c012b2b1655a21fc8982

(cherry picked from commit a29f37c14a)
This commit is contained in:
Wohlstand authored and Sam Lantinga committed 2024-02-03 06:19:26 -08:00
1 parent 384fcea585
commit fe297fc6d8
1 file changed
+4 -4
+4 -4
View File
@@ -549,11 +549,11 @@ static int WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs)
_this->gl_data->wglChoosePixelFormatARB(hdc, iAttribs, fAttribs,
1, &pixel_format,
&matching);
}
/* Check whether we actually got an SRGB capable buffer */
_this->gl_data->wglGetPixelFormatAttribivARB(hdc, pixel_format, 0, 1, &qAttrib, &srgb);
_this->gl_config.framebuffer_srgb_capable = srgb;
/* Check whether we actually got an SRGB capable buffer */
_this->gl_data->wglGetPixelFormatAttribivARB(hdc, pixel_format, 0, 1, &qAttrib, &srgb);
_this->gl_config.framebuffer_srgb_capable = srgb;
}
_this->gl_data->wglMakeCurrent(hdc, NULL);
_this->gl_data->wglDeleteContext(hglrc);