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

Unverified Commit ab53291d authored by Andy Hung's avatar Andy Hung Committed by Kevin F. Haggerty
Browse files

AudioFlinger: put effect desc lookup under mutex for createEffect

Test: native poc
Bug: 122309228
Change-Id: I48333c69f5c1b1bf1b98f57eb813ec39e074f3a7
Merged-In: I9d339a7d6d81161065e1adaf427dd2d3430436c2
(cherry picked from commit a41770b6)
parent 024e9c7e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2888,6 +2888,8 @@ sp<IEffect> AudioFlinger::createEffect(
    }

    {
        Mutex::Autolock _l(mLock);

        if (!EffectsFactoryHalInterface::isNullUuid(&pDesc->uuid)) {
            // if uuid is specified, request effect descriptor
            lStatus = mEffectsFactoryHal->getDescriptor(&pDesc->uuid, &desc);
@@ -2943,6 +2945,8 @@ sp<IEffect> AudioFlinger::createEffect(
                desc = d;
            }
        }
    }
    {

        // Do not allow auxiliary effects on a session different from 0 (output mix)
        if (sessionId != AUDIO_SESSION_OUTPUT_MIX &&