Validate that line width is not NaN.

BUG=668223

Change-Id: I2f38b358dd4a6b9327562704dacce37f2b16acaa
Reviewed-on: https://chromium-review.googlesource.com/417192
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 943a73e..ea3bbf9 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -3864,4 +3864,15 @@
     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