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

Commit 08419c3c authored by Zhijun He's avatar Zhijun He Committed by The Android Automerger
Browse files

camera2/3: Add protection to callback processing call

Callback stream in callbackprocessor could be delleted while process or
discard callback are ongoing, which leads CpuConsumer related call crash.

Bug 9303911

Change-Id: Ib6137e512208e5603468eba166640729b744e8f9
parent 5c192e5d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -182,6 +182,13 @@ bool CallbackProcessor::threadLoop() {
    }

    do {
        Mutex::Autolock l(mInputMutex);
        if (mCallbackStreamId == NO_STREAM) {
            ALOGV("%s: Camera %d:No stream is available"
                    , __FUNCTION__, mId);
            break;
        }

        sp<Camera2Client> client = mClient.promote();
        if (client == 0) {
            res = discardNewCallback();