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:
parent
ff70da9157
commit
b8dcd6b985
|
@ -54,7 +54,7 @@ WireResult BufferConsumer<BufferT>::NextN(N count, T** data) {
|
||||||
|
|
||||||
// If size is zero then it indicates an overflow.
|
// If size is zero then it indicates an overflow.
|
||||||
auto size = WireAlignSizeofN<T>(count);
|
auto size = WireAlignSizeofN<T>(count);
|
||||||
if (size && *size > mSize) {
|
if (!size || *size > mSize) {
|
||||||
return WireResult::FatalError;
|
return WireResult::FatalError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue