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

Commit 5f431141 authored by danielml's avatar danielml Committed by Daniel Moral
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.
Change-Id: Ia00e9e3fcc737bfaf0a917f11690f15d686441ba
Signed-off-by: default avatardanielml <daniel@danielml.dev>
parent c8123dc4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,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;