From b8dcd6b985d925c2476c17759e90308c223c61e7 Mon Sep 17 00:00:00 2001 From: Loko Kung Date: Wed, 30 Nov 2022 22:35:09 +0000 Subject: [PATCH] Fix condition for memory allocation to check for nullopt. Bug: chromium:1394660 Change-Id: I54b395728c5a857fdcbff6a0f1c05c8db6051e5a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112443 Commit-Queue: Loko Kung Kokoro: Kokoro Reviewed-by: Austin Eng --- src/dawn/wire/BufferConsumer_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dawn/wire/BufferConsumer_impl.h b/src/dawn/wire/BufferConsumer_impl.h index 52b6720219..98e239028c 100644 --- a/src/dawn/wire/BufferConsumer_impl.h +++ b/src/dawn/wire/BufferConsumer_impl.h @@ -54,7 +54,7 @@ WireResult BufferConsumer::NextN(N count, T** data) { // If size is zero then it indicates an overflow. auto size = WireAlignSizeofN(count); - if (size && *size > mSize) { + if (!size || *size > mSize) { return WireResult::FatalError; }