Add missing null check for displaydata during window creation

Found in the wild from minidump reports. Unclear displaydata is null, but according
to the API it is possible for this call to return null so it seems like a valid check.
This commit is contained in:
Sam Lantinga 2024-03-06 13:33:27 -08:00
parent 610e798406
commit 6664a089d8
1 changed files with 4 additions and 0 deletions

View File

@ -446,6 +446,10 @@ int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI
SDL_VideoData *data = _this->driverdata;
SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window);
if (!displaydata) {
return SDL_SetError("Could not find display info");
}
const SDL_bool force_override_redirect = SDL_GetHintBoolean(SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT, SDL_FALSE);
SDL_WindowData *windowdata;
Display *display = data->display;