From 8fbd7dc735242aead450fdb553c014a389f8db1f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 3 Oct 2013 00:54:58 -0700 Subject: [PATCH] Fixed bug 2130 - Two members of Windows WindowData not initialized norfanin SetupWindowData in SDL_windowswindow.c doesn't initialize two members of SDL_WindowData with NULL. This is an issue because other parts of the SDL code seem to make the assumption that this is the case. WIN_DestroyWindowFramebuffer for example uses data->mdc and data->hbm if they're not NULL. --- src/video/windows/SDL_windowswindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index c28da5204..07b873f7f 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -113,7 +113,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) SDL_WindowData *data; /* Allocate the window data */ - data = (SDL_WindowData *) SDL_malloc(sizeof(*data)); + data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data)); if (!data) { return SDL_OutOfMemory(); }