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

Commit 208bc42d authored by danielml's avatar danielml Committed by Austin Borger
Browse files

libcameraservice: Use the correct vendor tag id type on filterParameters



This fixes an overflow caused by using the `int` type, thus breaking
the camera on cases where the actual vendor tag id is bigger than the
maximum value `int` can hold.

Test: Open camera, make sure that preview shows correctly and that
      there are no vendor tag errors in logs.
Signed-off-by: default avatardanielml <daniel@danielml.dev>
(cherry picked from https://android-review.googlesource.com/q/commit:753a9af448cacea5418da6e28adae30dc1b2f041)
Merged-In: I32bf9bcb7137990d28b9fcbe1b27bc41ebbd50ee
Change-Id: Ia00e9e3fcc737bfaf0a917f11690f15d686441ba
parent 7b0acc5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1133,7 +1133,7 @@ status_t mapRequestTemplateToAidl(camera_request_template_t templateId,
}

void filterParameters(const CameraMetadata& src, const CameraMetadata& deviceInfo,
        int vendorTagId, CameraMetadata& dst) {
        metadata_vendor_id_t vendorTagId, CameraMetadata& dst) {
    const CameraMetadata params(src);
    camera_metadata_ro_entry_t availableSessionKeys = deviceInfo.find(
            ANDROID_REQUEST_AVAILABLE_SESSION_KEYS);
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ status_t mapRequestTemplateToAidl(camera_request_template_t templateId,
        aidl::android::hardware::camera::device::RequestTemplate* tempId /*out*/);

void filterParameters(const CameraMetadata& src, const CameraMetadata& deviceInfo,
        int vendorTagId, CameraMetadata& dst);
        metadata_vendor_id_t vendorTagId, CameraMetadata& dst);

constexpr int32_t MAX_SURFACES_PER_STREAM = 4;