Merge "ExternalCameraHAL: Check for empty native handle instead of null." into main am: 7e4037cf01
am: b6452b7ad8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2787022 Change-Id: I644ac5a50758874af31c87e075eda77fe5483d6b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
a75bf4a77a
1 changed files with 5 additions and 2 deletions
|
@ -402,7 +402,10 @@ aidl::android::hardware::camera::common::Status importBufferImpl(
|
|||
buffer_handle_t buf,
|
||||
/*out*/ buffer_handle_t** outBufPtr) {
|
||||
using ::aidl::android::hardware::camera::common::Status;
|
||||
if (buf == nullptr && bufId == BUFFER_ID_NO_BUFFER) {
|
||||
// AIDL does not have null NativeHandles. It sends empty handles instead.
|
||||
// We check for when the buf is empty instead of when buf is null.
|
||||
bool isBufEmpty = buf == nullptr || (buf->numFds == 0 && buf->numInts == 0);
|
||||
if (isBufEmpty && bufId == BUFFER_ID_NO_BUFFER) {
|
||||
ALOGE("%s: bufferId %" PRIu64 " has null buffer handle!", __FUNCTION__, bufId);
|
||||
return Status::ILLEGAL_ARGUMENT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue