Skip to content
Snippets Groups Projects
Commit 075db78d authored by Chih-Yu Huang's avatar Chih-Yu Huang
Browse files

C2VdaBqBlockPool: close handle from C2AllocatorGralloc

At ag/13824423 we fixed the description of
WrapNativeCodec2GrallocHandle() that the returned handle should be
closed. This CL closes the handle if the ownership is not transfered
to C2GrallocAllocation via priorGraphicAllocation() call.

Bug: 181541291
Test: android.media.cts.AdaptivePlaybackTest

Change-Id: Ifbe842f715977f4f6f79dfd2b33efbee9c0d1191
parent ffd260c6
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,7 @@ std::shared_ptr<C2GraphicAllocation> ConvertGraphicBuffer2C2Allocation(
const auto err = allocator->priorGraphicAllocation(c2Handle, &allocation);
if (err != C2_OK) {
ALOGE("C2Allocator::priorGraphicAllocation() failed: %d", err);
native_handle_close(c2Handle);
native_handle_delete(c2Handle);
return nullptr;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment