mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1464698 - avoid creating wrapping source surface when GetBuffer fails. r=nical
We shouldn't be trying to create the wrapping source surface here here GetBuffer fails - in this case because of a shmem allocation failure. There are already ample log notes about the failure so just bailing out and not spewing more warning spam here seems like the right thing to do. Downwind code already deals with mFirstSource not being set, so we should be safe. Differential Revision: https://phabricator.services.mozilla.com/D100739
This commit is contained in:
parent
b3d468a5e8
commit
f36bfe25d7
@ -818,11 +818,14 @@ bool BufferTextureHost::EnsureWrappingTextureSource() {
|
||||
if (mFormat == gfx::SurfaceFormat::YUV) {
|
||||
mFirstSource = mProvider->CreateDataTextureSourceAroundYCbCr(this);
|
||||
} else {
|
||||
uint8_t* data = GetBuffer();
|
||||
if (!data) {
|
||||
return false;
|
||||
}
|
||||
RefPtr<gfx::DataSourceSurface> surf =
|
||||
gfx::Factory::CreateWrappingDataSourceSurface(
|
||||
GetBuffer(),
|
||||
ImageDataSerializer::ComputeRGBStride(mFormat, mSize.width), mSize,
|
||||
mFormat);
|
||||
data, ImageDataSerializer::ComputeRGBStride(mFormat, mSize.width),
|
||||
mSize, mFormat);
|
||||
if (!surf) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user