summaryrefslogtreecommitdiff
path: root/audio/core/all-versions/default/StreamOut.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-04-13 20:14:16 +0000
committerSteven Moreland <smoreland@google.com>2021-04-13 20:15:40 +0000
commita8ac7cf706be7a77589070ea7c62f8e1b94ce316 (patch)
tree05168a6bc57a026b476baa9bb3b96b84fc831e8f /audio/core/all-versions/default/StreamOut.cpp
parent844d21c665f1af0d395689c1fd6eeae804042b1b (diff)
audio HAL - fix UAFs
Bug: 185259758 Test: N/A Change-Id: I5ec70b098a00746108e10ab39e966607d78c84ae
Diffstat (limited to 'audio/core/all-versions/default/StreamOut.cpp')
-rw-r--r--audio/core/all-versions/default/StreamOut.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/core/all-versions/default/StreamOut.cpp b/audio/core/all-versions/default/StreamOut.cpp
index 5e4dd2ad40..6eed3daf12 100644
--- a/audio/core/all-versions/default/StreamOut.cpp
+++ b/audio/core/all-versions/default/StreamOut.cpp
@@ -398,8 +398,8 @@ 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>::make(&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();