From 83684f9c1387f8b2da6058d81e3fedf0e668ad92 Mon Sep 17 00:00:00 2001 From: Yunchao He Date: Sun, 24 Feb 2019 17:32:35 +0000 Subject: [PATCH] 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 Reviewed-by: Corentin Wallez --- src/dawn_native/InputState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dawn_native/InputState.cpp b/src/dawn_native/InputState.cpp index eb88ce7396..64400690c2 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 @@ namespace dawn_native { 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.