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

Commit b1e3b309 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by android-build-merger
Browse files

Merge "Camera: Camera3Device: Fix off-by-one error" into qt-dev

am: c3f0e695

Change-Id: I0ccdf3cf949b471106dd8f7e3b40bd8f135bc083
parents 3dc72951 c3f0e695
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4278,12 +4278,13 @@ status_t Camera3Device::HalInterface::configureStreams(const camera_metadata_t *
        // Start scan at i, with the assumption that the stream order matches
        size_t realIdx = i;
        bool found = false;
        for (size_t idx = 0; idx < finalConfiguration.streams.size(); idx++) {
        size_t halStreamCount = finalConfiguration.streams.size();
        for (size_t idx = 0; idx < halStreamCount; idx++) {
            if (finalConfiguration.streams[realIdx].v3_2.id == streamId) {
                found = true;
                break;
            }
            realIdx = (realIdx >= finalConfiguration.streams.size()) ? 0 : realIdx + 1;
            realIdx = (realIdx >= halStreamCount - 1) ? 0 : realIdx + 1;
        }
        if (!found) {
            ALOGE("%s: Stream %d not found in stream configuration response from HAL",