diff options
author | Steven Moreland <smoreland@google.com> | 2021-04-13 20:14:16 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2021-04-13 20:15:40 +0000 |
commit | a8ac7cf706be7a77589070ea7c62f8e1b94ce316 (patch) | |
tree | 05168a6bc57a026b476baa9bb3b96b84fc831e8f /audio/core/all-versions/default/StreamIn.cpp | |
parent | 844d21c665f1af0d395689c1fd6eeae804042b1b (diff) |
audio HAL - fix UAFs
Bug: 185259758
Test: N/A
Change-Id: I5ec70b098a00746108e10ab39e966607d78c84ae
Diffstat (limited to 'audio/core/all-versions/default/StreamIn.cpp')
-rw-r--r-- | audio/core/all-versions/default/StreamIn.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/core/all-versions/default/StreamIn.cpp b/audio/core/all-versions/default/StreamIn.cpp index 599f3c396e..2aeee43c59 100644 --- a/audio/core/all-versions/default/StreamIn.cpp +++ b/audio/core/all-versions/default/StreamIn.cpp @@ -413,8 +413,8 @@ Return<void> StreamIn::prepareForReading(uint32_t frameSize, uint32_t framesCoun // Create and launch the thread. auto tempReadThread = - std::make_unique<ReadThread>(&mStopReadThread, mStream, tempCommandMQ.get(), - tempDataMQ.get(), tempStatusMQ.get(), tempElfGroup.get()); + sp<ReadThread>::make(&mStopReadThread, mStream, tempCommandMQ.get(), tempDataMQ.get(), + tempStatusMQ.get(), tempElfGroup.get()); if (!tempReadThread->init()) { ALOGW("failed to start reader thread: %s", strerror(-status)); sendError(Result::INVALID_ARGUMENTS); @@ -430,7 +430,7 @@ Return<void> StreamIn::prepareForReading(uint32_t frameSize, uint32_t framesCoun mCommandMQ = std::move(tempCommandMQ); mDataMQ = std::move(tempDataMQ); mStatusMQ = std::move(tempStatusMQ); - mReadThread = tempReadThread.release(); + mReadThread = tempReadThread; mEfGroup = tempElfGroup.release(); #if MAJOR_VERSION <= 6 threadInfo.pid = getpid(); |