ObjectStorage Allocate nullptr when id is 0

Bug: chromium:1052673
Change-Id: I16e39807a48f7a2c937b2a993f3a17cc8f58eac3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16161
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_wire/server/ObjectStorage.h b/src/dawn_wire/server/ObjectStorage.h
index 55d6a09..e98966d 100644
--- a/src/dawn_wire/server/ObjectStorage.h
+++ b/src/dawn_wire/server/ObjectStorage.h
@@ -94,10 +94,10 @@
         }
 
         // Allocates the data for a given ID and returns it.
-        // Returns nullptr if the ID is already allocated, or too far ahead.
-        // Invalidates all the Data*
+        // Returns nullptr if the ID is already allocated, or too far ahead, or if ID is 0 (ID 0 is
+        // reserved for nullptr). Invalidates all the Data*
         Data* Allocate(uint32_t id) {
-            if (id > mKnown.size()) {
+            if (id == 0 || id > mKnown.size()) {
                 return nullptr;
             }