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

Commit d3f301cc authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audioflinger: Fix crash on patch creation attempt

The code for clearing software patch connections was missing
a check for a null track pointer.

Bug: 126789266
Bug: 128269566
Test: see repro steps in b/128269566
Change-Id: Ice6887622d5fa2fa3198ce15146bff3cb05f7451
parent 0428b8e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -543,7 +543,7 @@ void AudioFlinger::PatchPanel::Patch::clearConnections(PatchPanel *panel)
            __func__, mRecord.handle(), mPlayback.handle());
    mRecord.stopTrack();
    mPlayback.stopTrack();
    mRecord.track()->clearPeerProxy(); // mRecord stop is synchronous. Break PeerProxy sp<> cycle.
    mRecord.clearTrackPeer(); // mRecord stop is synchronous. Break PeerProxy sp<> cycle.
    mRecord.closeConnections(panel);
    mPlayback.closeConnections(panel);
}
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ private:
            mThread->addPatchTrack(mTrack);
            mTrack->setPeerProxy(peer, true /* holdReference */);
        }
        void clearTrackPeer() { if (mTrack) mTrack->clearPeerProxy(); }
        void stopTrack() { if (mTrack) mTrack->stop(); }

        void swap(Endpoint &other) noexcept {