Bug 1771254 - Work around zero-sized shmems. r=jimb

Depends on D151703

Differential Revision: https://phabricator.services.mozilla.com/D152080
This commit is contained in:
Nicolas Silva
2022-08-10 15:55:09 +00:00
parent 5fd15277ea
commit a325f6b52f

View File

@@ -74,7 +74,11 @@ already_AddRefed<Buffer> 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(