Explorar o código

Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks, Justin!).

Fixes Bugzilla #2177.
Ryan C. Gordon %!s(int64=12) %!d(string=hai) anos
pai
achega
72de99aed3
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/cpuinfo/SDL_cpuinfo.c

+ 1 - 0
src/cpuinfo/SDL_cpuinfo.c

@@ -642,6 +642,7 @@ SDL_GetSystemRAM(void)
 #ifdef __WIN32__
         if (SDL_SystemRAM <= 0) {
             MEMORYSTATUSEX stat;
+            stat.dwLength = sizeof(stat);
             if (GlobalMemoryStatusEx(&stat)) {
                 SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024));
             }