Merge "Close the handle returned by WrapNativeCodec2GrallocHandle()" into sc-dev

This commit is contained in:
Chih-yu Huang
2021-03-17 01:16:40 +00:00
committed by Android (Google) Code Review

View File

@@ -2260,6 +2260,8 @@ static void android_media_MediaCodec_native_queueHardwareBuffer(
c2_status_t c2err = sGrallocAlloc->priorGraphicAllocation(handle, &alloc);
if (c2err != C2_OK) {
ALOGW("Failed to wrap AHardwareBuffer into C2GraphicAllocation");
native_handle_close(handle);
native_handle_delete(handle);
throwExceptionAsNecessary(env, BAD_VALUE);
return;
}