When validating image size, use format for SubImage calls.
internalFormat is GL_NONE when validating these calls for glTexSubImage
and leads to an expected minimum size of 0.
Add extra unsized formats that are never supported to the format tables.
These are needed for determining the size of input data.
BUG=angleproject:2054
Change-Id: Ic827a279a246ff92c9f279232574521692b1c6f2
Reviewed-on: https://chromium-review.googlesource.com/526356
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 1cc3882..bfdbc07 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1170,7 +1170,7 @@
GLsizei width,
GLsizei height,
GLsizei depth,
- GLenum internalFormat,
+ GLenum format,
GLenum type,
const void *pixels,
GLsizei imageSize)
@@ -1184,7 +1184,8 @@
// ...the data would be unpacked from the buffer object such that the memory reads required
// would exceed the data store size.
- const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalFormat, type);
+ const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format, type);
+ ASSERT(formatInfo.internalFormat != GL_NONE);
const gl::Extents size(width, height, depth);
const auto &unpack = context->getGLState().getUnpackState();