Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 205b4017 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Automerger Merge Worker
Browse files

Camera: Allow 0-face notifications to be sent am: fbaedd7c am: 9227817b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/12394024

Change-Id: I4187f6abc80a3e9b015eadf47ed3a51b7280fcda
parents 0bb16567 9227817b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -142,7 +142,8 @@ status_t BnCameraClient::onTransact(
            camera_frame_metadata_t metadata;
            camera_frame_metadata_t metadata;
            if (data.dataAvail() > 0) {
            if (data.dataAvail() > 0) {
                metadata.number_of_faces = data.readInt32();
                metadata.number_of_faces = data.readInt32();
                if (metadata.number_of_faces <= 0 ||
                // Zero faces is a valid case, to notify clients that no faces are now visible
                if (metadata.number_of_faces < 0 ||
                        metadata.number_of_faces > (int32_t)(INT32_MAX / sizeof(camera_face_t))) {
                        metadata.number_of_faces > (int32_t)(INT32_MAX / sizeof(camera_face_t))) {
                    ALOGE("%s: Too large face count: %d", __FUNCTION__, metadata.number_of_faces);
                    ALOGE("%s: Too large face count: %d", __FUNCTION__, metadata.number_of_faces);
                    return BAD_VALUE;
                    return BAD_VALUE;