summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chih-yu Huang <akahuang@google.com> 2021-03-17 01:16:40 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-03-17 01:16:40 +0000
commit09cf0e5cead5c0556ed7d95daa16c29f0b645d41 (patch)
treee29435ac3dcf4f0915a482a05c2190a938a7cffc
parent134b935860f73bd9e16c4ef2f9539a03253fad31 (diff)
parentef546db381280f1f7097a4e39abe91b85b827dff (diff)
Merge "Close the handle returned by WrapNativeCodec2GrallocHandle()" into sc-dev
-rw-r--r--media/jni/android_media_MediaCodec.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 1870a939f0dc..7f5dd5d15dbe 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -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;
}