GPU Metal: Fix uninitialized memory

This commit is contained in:
Jan Sedivy 2024-08-31 15:31:50 +02:00 committed by Sam Lantinga
parent 2010a22f44
commit 00708b976a
1 changed files with 1 additions and 1 deletions

View File

@ -3407,7 +3407,7 @@ static bool METAL_ClaimWindow(
MetalWindowData *windowData = METAL_INTERNAL_FetchWindowData(window);
if (windowData == NULL) {
windowData = (MetalWindowData *)SDL_malloc(sizeof(MetalWindowData));
windowData = (MetalWindowData *)SDL_calloc(1, sizeof(MetalWindowData));
windowData->window = window;
if (METAL_INTERNAL_CreateSwapchain(renderer, windowData, SDL_GPU_SWAPCHAINCOMPOSITION_SDR, SDL_GPU_PRESENTMODE_VSYNC)) {