Procházet zdrojové kódy

win32: Don't set the display HDR values to uninitialized data

The HDR properties are zeroed and set in WIN_GetHDRProperties, and using the struct without calling this function results in sending uninitialized data.
Frank Praznik před 1 rokem
rodič
revize
fafc9f642a
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/video/windows/SDL_windowsmodes.c

+ 1 - 1
src/video/windows/SDL_windowsmodes.c

@@ -561,8 +561,8 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI
                 SDL_SetDisplayContentScale(existing_display, content_scale);
 #ifdef HAVE_DXGI1_6_H
                 WIN_GetHDRProperties(_this, hMonitor, &HDR);
-#endif
                 SDL_SetDisplayHDRProperties(existing_display, &HDR);
+#endif
             }
             goto done;
         }