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

Commit f054fc34 authored by Phil Burk's avatar Phil Burk
Browse files

AudioFlinger: add check for NULL mInput in MMAP Thread

exitStandby() was crashing if headphones were
unplugged between the open and start of a MMAP stream.

Bug: 120564294
Test: see repro steps in bug
Change-Id: Ic42743682ffeb48f2869eaa90581b4e4f7fcb1ab
parent b079c02b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -9146,7 +9146,13 @@ AudioFlinger::MmapCaptureThread::MmapCaptureThread(

status_t AudioFlinger::MmapCaptureThread::exitStandby()
{
    {
        // mInput might have been cleared by clearInput()
        Mutex::Autolock _l(mLock);
        if (mInput != nullptr && mInput->stream != nullptr) {
            mInput->stream->setGain(1.0f);
        }
    }
    return MmapThread::exitStandby();
}