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/validationES2.cpp b/src/libANGLE/validationES2.cpp
index dc3b49b..80aa0fb 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -1336,7 +1336,8 @@
}
}
- if (!ValidImageDataSize(context, target, width, height, 1, internalformat, type, pixels,
+ GLenum sizeCheckFormat = isSubImage ? format : internalformat;
+ if (!ValidImageDataSize(context, target, width, height, 1, sizeCheckFormat, type, pixels,
imageSize))
{
return false;