Skip to content

Commit

Permalink
Fixed crash if SDL_GetVideoDisplayForWindow() returns NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 13, 2024
1 parent 20cd429 commit 9a4ae4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/SDL_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,9 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
window->undefined_y = undefined_y;

SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
SDL_SetWindowHDRProperties(window, &display->HDR, false);
if (display) {
SDL_SetWindowHDRProperties(window, &display->HDR, false);
}

if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) {
SDL_Rect bounds;
Expand Down

0 comments on commit 9a4ae4b

Please sign in to comment.