From a8591d943b7079b17fdd018dc04ec9c71dc94ae4 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Sun, 19 Jul 2026 13:50:59 +0800 Subject: [PATCH] Fix #15985 --- src/video/android/SDL_androidvulkan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video/android/SDL_androidvulkan.c b/src/video/android/SDL_androidvulkan.c index 117f2dbd09..36c0cf62da 100644 --- a/src/video/android/SDL_androidvulkan.c +++ b/src/video/android/SDL_androidvulkan.c @@ -144,6 +144,11 @@ bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, " extension is not enabled in the Vulkan instance."); } + if (!windowData->native_window) { + // passing a NULL window violates Vulkan spec + return SDL_SetError("Android native window is not available for surface creation, usually because of backgrounding"); + } + SDL_zero(createInfo); createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; createInfo.pNext = NULL;