Skip to content

Commit

Permalink
Fix a crash when initializing with a null config.
Browse files Browse the repository at this point in the history
  • Loading branch information
mackron committed May 11, 2020
1 parent 27e5b51 commit 5d9ee73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions glbind.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
OpenGL API loader. Choice of public domain or MIT-0. See license statements at the end of this file.
glbind - v4.6.8 - 2020-04-13
glbind - v4.6.9 - 2020-05-11

David Reid - davidreidsoftware@gmail.com
*/
Expand Down Expand Up @@ -20110,10 +20110,14 @@ GLenum glbInit(GLBapi* pAPI, GLBconfig* pConfig)
/* Here is where we need to initialize our dummy objects so we can get a context and retrieve some API pointers. */
#if defined(GLBIND_WGL)
{
HWND hWnd = pConfig->hWnd;
HWND hWnd = NULL;

if (pConfig != NULL) {
hWnd = pConfig->hWnd;
}

/* Create a dummy window if we haven't passed in an explicit window. */
if (pConfig->hWnd == 0) {
if (hWnd == NULL) {
WNDCLASSEXW dummyWC;
memset(&dummyWC, 0, sizeof(dummyWC));
dummyWC.cbSize = sizeof(dummyWC);
Expand Down
8 changes: 6 additions & 2 deletions source/glbind_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,14 @@ GLenum glbInit(GLBapi* pAPI, GLBconfig* pConfig)
/* Here is where we need to initialize our dummy objects so we can get a context and retrieve some API pointers. */
#if defined(GLBIND_WGL)
{
HWND hWnd = pConfig->hWnd;
HWND hWnd = NULL;

if (pConfig != NULL) {
hWnd = pConfig->hWnd;
}

/* Create a dummy window if we haven't passed in an explicit window. */
if (pConfig->hWnd == 0) {
if (hWnd == NULL) {
WNDCLASSEXW dummyWC;
memset(&dummyWC, 0, sizeof(dummyWC));
dummyWC.cbSize = sizeof(dummyWC);
Expand Down

0 comments on commit 5d9ee73

Please sign in to comment.