Commit 47c48080 by Geoff Lang Committed by Commit Bot

Validate that line width is not NaN.

BUG=668223 Change-Id: I2f38b358dd4a6b9327562704dacce37f2b16acaa Reviewed-on: https://chromium-review.googlesource.com/417192Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 2d73665d
......@@ -3864,4 +3864,15 @@ bool ValidateGetString(Context *context, GLenum name)
return true;
}
bool ValidateLineWidth(ValidationContext *context, GLfloat width)
{
if (width <= 0.0f || isNaN(width))
{
context->handleError(Error(GL_INVALID_VALUE, "Invalid width value."));
return false;
}
return true;
}
} // namespace gl
......@@ -371,6 +371,7 @@ bool ValidateBlendFuncSeparate(ValidationContext *context,
GLenum dstAlpha);
bool ValidateGetString(Context *context, GLenum name);
bool ValidateLineWidth(ValidationContext *context, GLfloat width);
} // namespace gl
......
......@@ -1806,9 +1806,8 @@ void GL_APIENTRY LineWidth(GLfloat width)
Context *context = GetValidGlobalContext();
if (context)
{
if (width <= 0.0f)
if (!context->skipValidation() && !ValidateLineWidth(context, width))
{
context->handleError(Error(GL_INVALID_VALUE));
return;
}
......
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