AudioFlinger: Do not dereference null track
Test: compile (original bug occurred during sanity testing)
Bug: 116142034
Change-Id: I33d77bf1970dfdd96706ace8f858baf5d473a59f
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 6e65ac0..06975ac 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -746,7 +746,7 @@
output.afFrameCount = thread->frameCount();
output.afSampleRate = thread->sampleRate();
output.afLatencyMs = thread->latency();
- output.trackId = track->id();
+ output.trackId = track == nullptr ? -1 : track->id();
// move effect chain to this output thread if an effect on same session was waiting
// for a track to be created