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

Commit 32777e49 authored by Andy Hung's avatar Andy Hung Committed by Android Build Coastguard Worker
Browse files

MMapTrack: Fix nullptr crash when ATRACE audio is enabled

MMapTrack and PatchTracks may have null clients.

Flag: EXEMPT bugfix
Test: Perfetto with Oboetester
Bug: 383354934
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a6a2410be108d99db3875a3f9cedf60481772487)
Merged-In: Ia66329d60293f538aed4fa480f97d88404204d2b
Change-Id: Ia66329d60293f538aed4fa480f97d88404204d2b
parent 68f4d479
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -367,7 +367,8 @@ audio_utils::trace::Object TrackBase::createDeviceIntervalTrace(const std::strin
            .set(AUDIO_TRACE_OBJECT_KEY_FLAGS, trackFlagsAsString())
            .set(AUDIO_TRACE_OBJECT_KEY_FORMAT, IAfThreadBase::formatToString(mFormat))
            .set(AUDIO_TRACE_OBJECT_KEY_FRAMECOUNT, static_cast<int64_t>(mFrameCount))
            .set(AUDIO_TRACE_OBJECT_KEY_PID, static_cast<int32_t>(mClient->pid()))
            .set(AUDIO_TRACE_OBJECT_KEY_PID, static_cast<int32_t>(
                    mClient ? mClient->pid() : getpid()))
            .set(AUDIO_TRACE_OBJECT_KEY_SAMPLE_RATE, static_cast<int32_t>(sampleRate()));
    if (const auto thread = mThread.promote()) {
        trace // continue in alphabetical order