зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1164513 - Add nullptr check r=milan
This commit is contained in:
Родитель
5161dd9e6b
Коммит
59b114892e
|
@ -364,7 +364,11 @@ android::sp<android::GraphicBuffer>
|
|||
SharedBufferManagerParent::GetGraphicBuffer(GrallocBufferRef aRef)
|
||||
{
|
||||
MonitorAutoLock lock(*sManagerMonitor.get());
|
||||
return GetInstance(aRef.mOwner)->GetGraphicBuffer(aRef.mKey);
|
||||
SharedBufferManagerParent* parent = GetInstance(aRef.mOwner);
|
||||
if (!parent) {
|
||||
return nullptr;
|
||||
}
|
||||
return parent->GetGraphicBuffer(aRef.mKey);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -231,6 +231,9 @@ GrallocTextureHostOGL::GetRenderState()
|
|||
TemporaryRef<gfx::DataSourceSurface>
|
||||
GrallocTextureHostOGL::GetAsSurface() {
|
||||
android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
|
||||
if (!graphicBuffer) {
|
||||
return nullptr;
|
||||
}
|
||||
uint8_t* grallocData;
|
||||
graphicBuffer->lock(GRALLOC_USAGE_SW_READ_OFTEN, reinterpret_cast<void**>(&grallocData));
|
||||
RefPtr<gfx::DataSourceSurface> grallocTempSurf =
|
||||
|
|
Загрузка…
Ссылка в новой задаче