Commit 487653b1 by Corentin Wallez Committed by Commit Bot

Don't divide in the validation of DrawElements

BUG=angleproject:1671 Change-Id: I58dd30d0aaffd1a776aa14a04011cbdd72181bf2 Reviewed-on: https://chromium-review.googlesource.com/648356 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 6ab833ad
......@@ -2871,8 +2871,8 @@ bool ValidateDrawElementsCommon(ValidationContext *context,
return false;
}
ASSERT(typeSize > 0);
if (elementArrayBuffer->getSize() % typeSize != 0)
ASSERT(isPow2(typeSize) && typeSize > 0);
if ((elementArrayBuffer->getSize() & (typeSize - 1)) != 0)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), MismatchedByteCountType);
return false;
......
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