ソースを参照

Zero-initialize SDL_GPUDevice

Mathieu Eyraud 1 週間 前
コミット
86da08b0be
1 ファイル変更1 行追加1 行削除
  1. 1 1
      src/gpu/vulkan/SDL_gpu_vulkan.c

+ 1 - 1
src/gpu/vulkan/SDL_gpu_vulkan.c

@@ -11914,7 +11914,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
     }
     }
 
 
     // FIXME: just move this into this function
     // FIXME: just move this into this function
-    result = (SDL_GPUDevice *)SDL_malloc(sizeof(SDL_GPUDevice));
+    result = (SDL_GPUDevice *)SDL_calloc(1, sizeof(SDL_GPUDevice));
     ASSIGN_DRIVER(VULKAN)
     ASSIGN_DRIVER(VULKAN)
 
 
     result->driverData = (SDL_GPURenderer *)renderer;
     result->driverData = (SDL_GPURenderer *)renderer;