Audio: fix the null pointer crash issue caused by accessing destroyed output
[cause]: When the output is closed in the offload or direct scenario,
the mOutput will be set to null and deleted in closeoutput. However, the
application side can still access the mOutput through AudioTrack's
getPlaybackRate and ultimately call Track::getPlaybackRateParameters.
Within this function, the mOutput is still accessed, leading to a
potential null pointer crash issue.
[solution]: add a null check condition for mOutput.
Flag: EXEMPT bugfix
Bug: 435277783
Test: atest CtsMediaAudioTestCases
Change-Id: Iab8c51a3a73c6be5a846cf85a31e7ee54c0a6e36
Signed-off-by:
chenmeijia <chenmeijia@xiaomi.com>
Loading
Please register or sign in to comment