From d13e46158afd6ff23178f015285535e5bf00dd2c Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 16 Oct 2009 18:34:31 -0700 Subject: fix [2151588] glTexSubImage2D() allows pixel format conversion --- opengl/libagl/texture.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'opengl/libagl/texture.cpp') diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 90e6d2946a..13d078e2a3 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -1252,6 +1252,11 @@ void glTexSubImage2D( ogles_error(c, GL_INVALID_OPERATION); return; } + + if (format != tex->internalformat) { + ogles_error(c, GL_INVALID_OPERATION); + return; + } if ((xoffset + width > GLsizei(surface.width)) || (yoffset + height > GLsizei(surface.height))) { ogles_error(c, GL_INVALID_VALUE); -- cgit v1.2.3-59-g8ed1b