From c3a830e9e69d1d38f1a493797a0f7fe9ba88d820 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 2 Jul 2026 18:05:53 +0800 Subject: [PATCH] [Fix] (MG_Impl/GLImpl): validate DSA texture unit binding [skip ci] --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 80e934d9..1906fa19 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -2884,8 +2884,13 @@ namespace MobileGL::MG_Impl::GLImpl { return; } - auto textureObject = GetTextureObjectByName(texture, __func__); - if (!textureObject) return; + auto& textureObject = MG_State::pGLContext->GetTextureObject(texture); + if (!textureObject) { + MG_State::pGLContext->RecordError( + ErrorCode::InvalidOperation, + MakeUnique("MG_Impl/GLImpl", __func__, "Texture object does not exist.")); + return; + } textureUnit.GetBindingSlot(textureObject->GetTarget()).Bind(textureObject); }