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

Commit 3d33019b authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Camera2: Fix off-by-one error in ZSL selection.

Bug: 7258126
Change-Id: Ie6da4645c46a7bb0dbd11d7c6183e904f41f74fd
parent 3dcdc3d0
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -254,11 +254,14 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) {
    if (mZslQueueTail != mZslQueueHead) {
        CameraMetadata request;
        size_t index = mZslQueueTail;
        while (request.isEmpty() && index != mZslQueueHead) {
        while (index != mZslQueueHead) {
            if (!mZslQueue[index].frame.isEmpty()) {
                request = mZslQueue[index].frame;
                break;
            }
            index = (index + 1) % kZslBufferDepth;
        }
        if (request.isEmpty()) {
        if (index == mZslQueueHead) {
            ALOGV("%s: ZSL queue has no valid frames to send yet.",
                  __FUNCTION__);
            return NOT_ENOUGH_DATA;