зеркало из https://github.com/mozilla/gecko-dev.git
Bug 809259: Properly handle allocation failures. r=kanru
This commit is contained in:
Родитель
b302b0b395
Коммит
57c48cf12d
|
@ -263,11 +263,15 @@ int GonkNativeWindow::dequeueBuffer(android_native_buffer_t** buffer)
|
||||||
mPixelFormat,
|
mPixelFormat,
|
||||||
mUsage,
|
mUsage,
|
||||||
&buffer);
|
&buffer);
|
||||||
sp<GraphicBuffer> graphicBuffer =
|
// We can only use a gralloc buffer here. If we didn't get
|
||||||
GrallocBufferActor::GetFrom(buffer.get_SurfaceDescriptorGralloc());
|
// one back, something went wrong.
|
||||||
if (!graphicBuffer.get()) {
|
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != buffer.type()) {
|
||||||
|
MOZ_ASSERT(SurfaceDescriptor::T__None == buffer.type());
|
||||||
|
CNW_LOGE("dequeueBuffer: failed to alloc gralloc buffer");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
sp<GraphicBuffer> graphicBuffer =
|
||||||
|
GrallocBufferActor::GetFrom(buffer.get_SurfaceDescriptorGralloc());
|
||||||
error = graphicBuffer->initCheck();
|
error = graphicBuffer->initCheck();
|
||||||
if (error != NO_ERROR) {
|
if (error != NO_ERROR) {
|
||||||
CNW_LOGE("dequeueBuffer: createGraphicBuffer failed with error %d",error);
|
CNW_LOGE("dequeueBuffer: createGraphicBuffer failed with error %d",error);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче