mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-14 18:27:50 +00:00
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 0ccf272eea)
This commit is contained in:
parent
38a5bca892
commit
0c3603d893
1 changed files with 1 additions and 1 deletions
|
|
@ -1435,7 +1435,7 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
|
|||
{
|
||||
SDL_DisplayMode last_mode;
|
||||
|
||||
if (display->fullscreen_window || display->device->setting_display_mode) {
|
||||
if (display->fullscreen_window || (display->device && display->device->setting_display_mode)) {
|
||||
// This is a temporary mode change, don't save the desktop mode
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue