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

Commit c4f7d87f authored by Andy Hung's avatar Andy Hung
Browse files

AudioSystem: Ensure no nullptr access

Brute force nullptr check for safety. A warning is
issued if nullptr is found, but it should not occur.

Flag: EXEMPT bugfix
Test: for run in {1..100}; do (sleep 8; echo $run; adb shell pkill audioserver); done
Bug: 379427790
Change-Id: I3ba7a89ecfaf35b658de9477e3f27dc3a59352b2
parent d0d2e85f
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -151,7 +151,11 @@ public:
        {
            std::lock_guard l(mMutex);
            mValid = false;
            if (mClient) {
                mClient->clearIoCache();
            } else {
                ALOGW("%s: null client", __func__);
            }
        }
        AudioSystem::reportError(DEAD_OBJECT);
    }
@@ -1004,7 +1008,11 @@ public:
            mValid = false;
            client = mClient;
        }
        if (client) {
            client->onServiceDied();
        } else {
            ALOGW("%s: null client", __func__);
        }
    }

    static constexpr mediautils::ServiceOptions options() {