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

Commit bc2a37f4 authored by Jayant Chowdhary's avatar Jayant Chowdhary
Browse files

camera2 ndk: Add some null checks before dereferencing captureSequenceId.



Test: AImageReaderVendorTest

Change-Id: Icdb11569305cdbf4e4f9c791b306292e46395271
Signed-off-by: default avatarJayant Chowdhary <jchowdhary@google.com>
parent 0428b8e5
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -105,7 +105,9 @@ camera_status_t ACameraCaptureSession_logicalCamera_capture(

    if (session->isClosed()) {
        ALOGE("%s: session %p is already closed", __FUNCTION__, session);
        if (captureSequenceId) {
            *captureSequenceId = CAPTURE_SEQUENCE_ID_NONE;
        }
        return ACAMERA_ERROR_SESSION_CLOSED;
    }

@@ -127,7 +129,9 @@ camera_status_t ACameraCaptureSession_setRepeatingRequest(

    if (session->isClosed()) {
        ALOGE("%s: session %p is already closed", __FUNCTION__, session);
        if (captureSequenceId) {
            *captureSequenceId = CAPTURE_SEQUENCE_ID_NONE;
        }
        return ACAMERA_ERROR_SESSION_CLOSED;
    }

@@ -149,7 +153,9 @@ camera_status_t ACameraCaptureSession_logicalCamera_setRepeatingRequest(

    if (session->isClosed()) {
        ALOGE("%s: session %p is already closed", __FUNCTION__, session);
        if (captureSequenceId) {
            *captureSequenceId = CAPTURE_SEQUENCE_ID_NONE;
        }
        return ACAMERA_ERROR_SESSION_CLOSED;
    }