Bug 1248276: getStagingStorage could return null. Wallpaper, speculative fix. r?jrmuizel
MozReview-Commit-ID: GYSrJI94rCQ
--- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
@@ -767,16 +767,21 @@ void Buffer11::updateBufferStorage(Buffe
// Copy through a staging buffer if we're copying from or to a non-staging, mappable
// buffer storage. This is because we can't map a GPU buffer, and copy CPU
// data directly. If we're already using a staging buffer we're fine.
if (latestBuffer->getUsage() != BUFFER_USAGE_STAGING &&
storage->getUsage() != BUFFER_USAGE_STAGING &&
(!latestBuffer->isMappable() || !storage->isMappable()))
{
NativeStorage *stagingBuffer = getStagingStorage();
+ if (!stagingBuffer)
+ {
+ // gl::Error(GL_OUT_OF_MEMORY, "Failed to allocate internal buffer.");
+ return;
+ }
stagingBuffer->copyFromStorage(latestBuffer, 0, latestBuffer->getSize(), 0);
stagingBuffer->setDataRevision(latestBuffer->getDataRevision());
latestBuffer = stagingBuffer;
}
// if copyFromStorage returns true, the D3D buffer has been recreated