summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-10-16 18:34:31 -0700
committerMathias Agopian <mathias@google.com>2009-10-19 14:23:02 -0700
commit78811906c3a8a99a155543eda73f51914143277a (patch)
treed684be0e7901e24e72d212bdf0818c3cbb185ff8 /opengl
parent69fba87ac16d1c10da81fc3213ae169c755797f4 (diff)
downloadframeworks_base-78811906c3a8a99a155543eda73f51914143277a.zip
frameworks_base-78811906c3a8a99a155543eda73f51914143277a.tar.gz
frameworks_base-78811906c3a8a99a155543eda73f51914143277a.tar.bz2
fix [2151588] glTexSubImage2D() allows pixel format conversion
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libagl/texture.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp
index 90e6d29..13d078e 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);