Validate vertex format for Input State

BUG=chromium:935078, chromium:935026

Change-Id: I9c27cae2a0aa1ec23b8203a4d9b95e1d6d98a868
Reviewed-on: https://dawn-review.googlesource.com/c/5020
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/InputState.cpp b/src/dawn_native/InputState.cpp
index eb88ce7..6440069 100644
--- a/src/dawn_native/InputState.cpp
+++ b/src/dawn_native/InputState.cpp
@@ -16,6 +16,7 @@
 
 #include "common/Assert.h"
 #include "dawn_native/Device.h"
+#include "dawn_native/ValidationUtils_autogen.h"
 
 namespace dawn_native {
 
@@ -135,6 +136,9 @@
             HandleError("Binding slot out of bounds");
             return;
         }
+        if (GetDevice()->ConsumedError(ValidateVertexFormat(attribute->format))) {
+            return;
+        }
         // If attribute->offset is close to 0xFFFFFFFF, the validation below to add
         // attribute->offset and VertexFormatSize(attribute->format) might overflow on a
         // 32bit machine, then it can pass the validation incorrectly. We need to catch it.