SDL: Fixed error: cast from pointer to integer of different size

From 08b9c55393be5cb08fbec12ca431470faba3c8c9 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 17 Jul 2026 22:08:39 -0700
Subject: [PATCH] Fixed error: cast from pointer to integer of different size

---
 test/testffmpeg_vulkan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c
index ad7dfcf1a08fe..64976dd5756a5 100644
--- a/test/testffmpeg_vulkan.c
+++ b/test/testffmpeg_vulkan.c
@@ -940,7 +940,7 @@ static bool FindMemoryIndex(VulkanVideoContext *context, uint32_t memoryTypeBits
 static void SDLCALL CleanupExternalVulkanImage(void *userdata, void *value)
 {
     VulkanVideoContext *context = (VulkanVideoContext *)userdata;
-    VkImage image = (VkImage)value;
+    VkImage image = (VkImage)(uintptr_t)value;
 
     context->vkDestroyImage(context->device, image, NULL);
 }
@@ -948,7 +948,7 @@ static void SDLCALL CleanupExternalVulkanImage(void *userdata, void *value)
 static void SDLCALL CleanupExternalVulkanImageMemory(void *userdata, void *value)
 {
     VulkanVideoContext *context = (VulkanVideoContext *)userdata;
-    VkDeviceMemory imageMemory = (VkDeviceMemory)value;
+    VkDeviceMemory imageMemory = (VkDeviceMemory)(uintptr_t)value;
 
     context->vkFreeMemory(context->device, imageMemory, NULL);
 }
@@ -963,6 +963,7 @@ static SDL_Texture *CreateVulkanVideoTexturePixFmtDRMPrime(VulkanVideoContext *c
     VkResult result;
     VkImage image = 0;
     VkDeviceMemory imageMemory = 0;
+    uint32_t memoryTypeIndex = 0;
     SDL_Texture *texture;
 
     if (drm_desc->nb_objects != 1) {
@@ -1098,7 +1099,6 @@ static SDL_Texture *CreateVulkanVideoTexturePixFmtDRMPrime(VulkanVideoContext *c
     import_fd_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
     import_fd_info.fd = dma_buf_fds[0];
 
-    uint32_t memoryTypeIndex;
     if (!FindMemoryIndex(context, mem_reqs.memoryTypeBits, &memoryTypeIndex)) {
         goto error;
     }
@@ -1127,8 +1127,8 @@ static SDL_Texture *CreateVulkanVideoTexturePixFmtDRMPrime(VulkanVideoContext *c
 
     // Make sure this image is freed when the texture is destroyed
     props = SDL_GetTextureProperties(texture);
-    SDL_SetPointerPropertyWithCleanup(props, "CleanupVulkanImage", (void *)image, CleanupExternalVulkanImage, context);
-    SDL_SetPointerPropertyWithCleanup(props, "CleanupVulkanImageMemory", (void *)imageMemory, CleanupExternalVulkanImageMemory, context);
+    SDL_SetPointerPropertyWithCleanup(props, "CleanupVulkanImage", (void *)(uintptr_t)image, CleanupExternalVulkanImage, context);
+    SDL_SetPointerPropertyWithCleanup(props, "CleanupVulkanImageMemory", (void *)(uintptr_t)imageMemory, CleanupExternalVulkanImageMemory, context);
 
     return texture;