diff options
author | Steven Moreland <smoreland@google.com> | 2021-04-26 23:10:51 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-26 23:10:51 +0000 |
commit | f07b44c1f9679c1fa8d6cf384aa2501b61b27a24 (patch) | |
tree | 23d8e85469611a94d7b593f79f63d6d0f520e7ec /audio/core/all-versions/default/StreamOut.cpp | |
parent | 8ae4e17e415866be1c897fda5aefe3d2e1e91f9f (diff) | |
parent | da947d51277c22aa80523bf57c4dd4bd6e1d3d18 (diff) |
audio HAL - fix UAFs am: 7283cbe8cb am: e227bfd15c am: facfee6382 am: da947d5127
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/14212414
Change-Id: I7c4ba7e1ed4e7c71e10332ce986bbc7b6aba8f40
Diffstat (limited to 'audio/core/all-versions/default/StreamOut.cpp')
-rw-r--r-- | audio/core/all-versions/default/StreamOut.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp index a089f6baf9..0a7c64b4b9 100644 --- a/audio/core/all-versions/default/StreamOut.cpp +++ b/audio/core/all-versions/default/StreamOut.cpp @@ -397,9 +397,9 @@ Return<void> StreamOut::prepareForWriting(uint32_t frameSize, uint32_t framesCou } // Create and launch the thread. - auto tempWriteThread = - std::make_unique<WriteThread>(&mStopWriteThread, mStream, tempCommandMQ.get(), - tempDataMQ.get(), tempStatusMQ.get(), tempElfGroup.get()); + sp<WriteThread> tempWriteThread = + new WriteThread(&mStopWriteThread, mStream, tempCommandMQ.get(), tempDataMQ.get(), + tempStatusMQ.get(), tempElfGroup.get()); if (!tempWriteThread->init()) { ALOGW("failed to start writer thread: %s", strerror(-status)); sendError(Result::INVALID_ARGUMENTS); @@ -415,7 +415,7 @@ Return<void> StreamOut::prepareForWriting(uint32_t frameSize, uint32_t framesCou mCommandMQ = std::move(tempCommandMQ); mDataMQ = std::move(tempDataMQ); mStatusMQ = std::move(tempStatusMQ); - mWriteThread = tempWriteThread.release(); + mWriteThread = tempWriteThread; mEfGroup = tempElfGroup.release(); #if MAJOR_VERSION <= 6 threadInfo.pid = getpid(); |