Commit c5508d6e by Geoff Lang Committed by Commit Bot

Validate that the format is compressed before calculating data size.

glCompressedTexImage3D was missing a check that the format was valid before trying to compute the expected data size. This lead to an assertion failure in the size computation code. BUG=602737 Change-Id: I74e6ced082e78396a0af92317fb1c0098299a026 Reviewed-on: https://chromium-review.googlesource.com/441185Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 5f45e7c3
......@@ -1621,6 +1621,12 @@ bool ValidateCompressedTexSubImage3D(Context *context,
}
const InternalFormat &formatInfo = GetInternalFormatInfo(format);
if (!formatInfo.compressed)
{
context->handleError(Error(GL_INVALID_ENUM, "Not a valid compressed texture format"));
return false;
}
auto blockSizeOrErr =
formatInfo.computeCompressedImageSize(GL_UNSIGNED_BYTE, gl::Extents(width, height, depth));
if (blockSizeOrErr.isError())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment