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

Commit 3e28e52e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Camera: verify per-frame metadata when ALOGV is enabled" into main

parents 3b064c79 274a28cd
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -132,10 +132,12 @@ void CameraMetadata::acquire(camera_metadata_t *buffer) {
    clear();
    mBuffer = buffer;

    IF_ALOGV() {
        ALOGE_IF(validate_camera_metadata_structure(mBuffer, /*size*/NULL) != OK,
                 "%s: Failed to validate metadata structure %p",
                 __FUNCTION__, buffer);
    }
}

void CameraMetadata::acquire(CameraMetadata &other) {
    if (mLocked) {
@@ -712,10 +714,12 @@ status_t CameraMetadata::writeToParcel(Parcel& data,

        // Not too big of a problem since receiving side does hard validation
        // Don't check the size since the compact size could be larger
        IF_ALOGV() {
            if (validate_camera_metadata_structure(metadata, /*size*/NULL) != OK) {
                ALOGW("%s: Failed to validate metadata %p before writing blob",
                       __FUNCTION__, metadata);
            }
        }

    } while(false);
    blob.release();