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

Commit 5ea07527 authored by Wonsik Kim's avatar Wonsik Kim Committed by android-build-merger
Browse files

Merge "MediaCodec: don't crash on concurrent release/allocate" into qt-dev am: f151b811

am: 3831f1f8

Change-Id: Ib70077e6085408014ea92829c574f605c2696735
parents 6ff4d2f1 3831f1f8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1934,6 +1934,13 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {

                case kWhatComponentAllocated:
                {
                    if (mState == RELEASING || mState == UNINITIALIZED) {
                        // In case a kWhatError or kWhatRelease message came in and replied,
                        // we log a warning and ignore.
                        ALOGW("allocate interrupted by error or release, current state %d",
                              mState);
                        break;
                    }
                    CHECK_EQ(mState, INITIALIZING);
                    setState(INITIALIZED);
                    mFlags |= kFlagIsComponentAllocated;