diff --git a/dom/webgpu/Buffer.cpp b/dom/webgpu/Buffer.cpp index fab13762de38..581d4056d9a2 100644 --- a/dom/webgpu/Buffer.cpp +++ b/dom/webgpu/Buffer.cpp @@ -74,7 +74,11 @@ already_AddRefed Buffer::Create(Device* aDevice, RawId aDeviceId, aRv.ThrowRangeError("Mappable size is too large"); return nullptr; } - const auto& size = checked.value(); + size_t size = checked.value(); + if (size == 0) { + // Can't send zero-sized shmems. + size = 1; + } if (!actor->AllocUnsafeShmem(size, &shmem)) { aRv.ThrowAbortError(