mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 809259: Properly handle allocation failures. r=kanru
This commit is contained in:
parent
05efb88c6b
commit
1b8eb2b047
@ -263,11 +263,15 @@ int GonkNativeWindow::dequeueBuffer(android_native_buffer_t** buffer)
|
||||
mPixelFormat,
|
||||
mUsage,
|
||||
&buffer);
|
||||
sp<GraphicBuffer> graphicBuffer =
|
||||
GrallocBufferActor::GetFrom(buffer.get_SurfaceDescriptorGralloc());
|
||||
if (!graphicBuffer.get()) {
|
||||
// We can only use a gralloc buffer here. If we didn't get
|
||||
// one back, something went wrong.
|
||||
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != buffer.type()) {
|
||||
MOZ_ASSERT(SurfaceDescriptor::T__None == buffer.type());
|
||||
CNW_LOGE("dequeueBuffer: failed to alloc gralloc buffer");
|
||||
return -ENOMEM;
|
||||
}
|
||||
sp<GraphicBuffer> graphicBuffer =
|
||||
GrallocBufferActor::GetFrom(buffer.get_SurfaceDescriptorGralloc());
|
||||
error = graphicBuffer->initCheck();
|
||||
if (error != NO_ERROR) {
|
||||
CNW_LOGE("dequeueBuffer: createGraphicBuffer failed with error %d",error);
|
||||
|
Loading…
Reference in New Issue
Block a user