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

Commit 3831f1f8 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

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


                case kWhatComponentAllocated:
                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);
                    CHECK_EQ(mState, INITIALIZING);
                    setState(INITIALIZED);
                    setState(INITIALIZED);
                    mFlags |= kFlagIsComponentAllocated;
                    mFlags |= kFlagIsComponentAllocated;