From 0e01a7281ea852e61de52aac13b1f5725e6fe031 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 28 Oct 2025 16:57:06 +0800 Subject: [PATCH] [Fix] (MG_State/GL_Texture): SubImage2D missing a row of texels --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index aae78fae..c6ef22a6 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -86,7 +86,7 @@ namespace MobileGL { // Should take states from glPixelStorei/glPixelStoref into account SizeT srcOffset = row * width * bytesPerPixel; - if (dstOffset + width * bytesPerPixel < data.size()) { + if (dstOffset + width * bytesPerPixel <= data.size()) { Memcpy(data.data() + dstOffset, srcData + srcOffset, width * bytesPerPixel); } else { MG_State::pGLContext->RecordError(