Преглед изворни кода

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 0ccf272eeadd7c0b3f7691e11d67b702f0bcd3e1)
Frank Praznik пре 1 година
родитељ
комит
0c3603d893
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/video/SDL_video.c

+ 1 - 1
src/video/SDL_video.c

@@ -1435,7 +1435,7 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
 {
 {
     SDL_DisplayMode last_mode;
     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
         // This is a temporary mode change, don't save the desktop mode
         return;
         return;
     }
     }