mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "ExternalCameraHAL: Check for empty native handle instead of null." into main
This commit is contained in:
@@ -402,7 +402,10 @@ aidl::android::hardware::camera::common::Status importBufferImpl(
|
|||||||
buffer_handle_t buf,
|
buffer_handle_t buf,
|
||||||
/*out*/ buffer_handle_t** outBufPtr) {
|
/*out*/ buffer_handle_t** outBufPtr) {
|
||||||
using ::aidl::android::hardware::camera::common::Status;
|
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);
|
ALOGE("%s: bufferId %" PRIu64 " has null buffer handle!", __FUNCTION__, bufId);
|
||||||
return Status::ILLEGAL_ARGUMENT;
|
return Status::ILLEGAL_ARGUMENT;
|
||||||
}
|
}
|
||||||
@@ -857,4 +860,4 @@ int AllocatedV4L2Frame::getData(uint8_t** outData, size_t* dataSize) {
|
|||||||
} // namespace device
|
} // namespace device
|
||||||
} // namespace camera
|
} // namespace camera
|
||||||
} // namespace hardware
|
} // namespace hardware
|
||||||
} // namespace android
|
} // namespace android
|
||||||
|
|||||||
Reference in New Issue
Block a user