Skip to content

Commit 0c3603d

Browse files
committed
Check the display device before dereferencing
It can be null if the desktop mode is set early during initial display enumeration. (cherry picked from commit 0ccf272)
1 parent 38a5bca commit 0c3603d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/video/SDL_video.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
14351435
{
14361436
SDL_DisplayMode last_mode;
14371437

1438-
if (display->fullscreen_window || display->device->setting_display_mode) {
1438+
if (display->fullscreen_window || (display->device && display->device->setting_display_mode)) {
14391439
// This is a temporary mode change, don't save the desktop mode
14401440
return;
14411441
}

0 commit comments

Comments
 (0)