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

Commit f151b811 authored by Wonsik Kim's avatar Wonsik Kim Committed by Android (Google) Code Review
Browse files

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

parents 05839181 00e1af96
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;