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 11:38:57 +00:00
Родитель 10ba2bff18
Коммит c48f4c8b0c
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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(