diff options
author | Steven Moreland <smoreland@google.com> | 2021-04-26 22:46:24 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-26 22:46:24 +0000 |
commit | da947d51277c22aa80523bf57c4dd4bd6e1d3d18 (patch) | |
tree | cff2581aa2bd27421b565bc3d0f04a654db29ede /audio/core/all-versions/default/StreamOut.cpp | |
parent | 041e19dd25403d6d8633bcc2519c45fdaf42bc2a (diff) | |
parent | facfee63827844fd9e7ce7611014436c6d445701 (diff) |
audio HAL - fix UAFs am: 7283cbe8cb am: e227bfd15c am: facfee6382
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/14212414
Change-Id: I50df59e828d44606c2fca8dc44830b5def4f9670
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 1519c48e12..af3307aaa5 100644 --- a/audio/core/all-versions/default/StreamOut.cpp +++ b/audio/core/all-versions/default/StreamOut.cpp @@ -376,9 +376,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); @@ -394,7 +394,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(); threadInfo.pid = getpid(); threadInfo.tid = mWriteThread->getTid(); |