소스 검색

Check the display device before dereferencing

It can be null if the desktop mode is set early during initial display enumeration.
Frank Praznik 6 달 전
부모
커밋
0ccf272eea
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;
 
-    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;
     }