From a6276aa8464ca792ef83fce22e9f915205d4bbe1 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 4 Nov 2026 23:17:28 -0600 Subject: [PATCH] Check for unbound texture before registering with CUDA --- app/streaming/video/ffmpeg-renderers/cuda.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/cuda.cpp b/app/streaming/video/ffmpeg-renderers/cuda.cpp index 89790933..60b794f8 100644 --- a/app/streaming/video/ffmpeg-renderers/cuda.cpp +++ b/app/streaming/video/ffmpeg-renderers/cuda.cpp @@ -111,6 +111,11 @@ bool CUDAGLInteropHelper::registerBoundTextures() // Get the ID of this plane's texture glActiveTexture(GL_TEXTURE0 + i); glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex); + if (tex == 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No GL texture bound to slot %d", i); + err = 211; // CUDA_ERROR_NOT_MAPPED + goto Exit; + } // Register it with CUDA err = m_Funcs->cuGraphicsGLRegisterImage(&m_Resources[i], tex, GL_TEXTURE_2D, CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD);