зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1565501 - use fallible memory allocation in MediaSpan. r=jya
Use fallible memory allocation in order to avoid the OOM issue. Differential Revision: https://phabricator.services.mozilla.com/D38400 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
afc3f16477
Коммит
23c2b98a25
|
@ -78,15 +78,15 @@ class MediaSpan {
|
|||
// append the new data into it.
|
||||
RefPtr<MediaByteBuffer> buffer =
|
||||
new MediaByteBuffer(mLength + aBuffer->Length());
|
||||
if (!buffer->AppendElements(Elements(), Length()) ||
|
||||
!buffer->AppendElements(*aBuffer)) {
|
||||
if (!buffer->AppendElements(Elements(), Length(), fallible) ||
|
||||
!buffer->AppendElements(*aBuffer, fallible)) {
|
||||
return false;
|
||||
}
|
||||
mBuffer = buffer;
|
||||
mLength += aBuffer->Length();
|
||||
return true;
|
||||
}
|
||||
if (!mBuffer->AppendElements(*aBuffer)) {
|
||||
if (!mBuffer->AppendElements(*aBuffer, fallible)) {
|
||||
return false;
|
||||
}
|
||||
mLength += aBuffer->Length();
|
||||
|
|
Загрузка…
Ссылка в новой задаче