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 <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Loko Kung 2022-11-30 22:35:09 +00:00 committed by Dawn LUCI CQ
parent ff70da9157
commit b8dcd6b985
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ WireResult BufferConsumer<BufferT>::NextN(N count, T** data) {
// If size is zero then it indicates an overflow.
auto size = WireAlignSizeofN<T>(count);
if (size && *size > mSize) {
if (!size || *size > mSize) {
return WireResult::FatalError;
}