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

Commit 78aade89 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix crash in checkOutputForAttributes

New implementation of checkOutputForAttributes() dereferences
the profile of an output descriptor without checking that this is not
a duplicated output first (duplicated outputs do not have a profile).

Bug: 140916168
Test: repro steps in bug
Change-Id: Ic15674edc245ae33e40d0a025ce79bffcea852b1
parent 61d4a093
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5098,7 +5098,7 @@ void AudioPolicyManager::checkOutputForAttributes(const audio_attributes_t &attr
            if (invalidate) continue;

            for (auto client : desc->clientsList(false /*activeOnly*/)) {
                if (!desc->mProfile->isDirectOutput()) {
                if (desc->isDuplicated() || !desc->mProfile->isDirectOutput()) {
                    // a client on a non direct outputs has necessarily a linear PCM format
                    // so we can call selectOutput() safely
                    const audio_io_handle_t newOutput = selectOutput(dstOutputs,