diff options
author | bodamnam <bodamnam@google.com> | 2023-04-11 02:43:53 +0000 |
---|---|---|
committer | Bodam Nam <bodamnam@google.com> | 2023-04-11 04:58:40 +0000 |
commit | 62f9a4c537210536d371f2a88690f01e7d2dbc2e (patch) | |
tree | d9eb140df19b97c09b1e5b2835aa77957d635e49 | |
parent | ffff185c086184397aac56637cfe2e5f74af065e (diff) | |
download | ImsMedia-62f9a4c537210536d371f2a88690f01e7d2dbc2e.tar.gz |
Fix the audio crash when open the audio player failed
The ImsMediaAudioPlayer will be crashed by null pointer exception when invokes stop method after openSession is failed. I added initialization of class member parameters to avoid null pointer exception.
Bug: 277535685
Bug: 277536259
Test: Verified simulation condition to test the audio player is in
exceptional state, atest ImsMediaNativeTests
Change-Id: I9f09cdbc44e8acdefbc05e60c76efdf408edbb58
-rw-r--r-- | service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/android/ImsMediaAudioPlayer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/android/ImsMediaAudioPlayer.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/android/ImsMediaAudioPlayer.cpp index 4a05166a..99ba77cc 100644 --- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/android/ImsMediaAudioPlayer.cpp +++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/android/ImsMediaAudioPlayer.cpp @@ -40,7 +40,14 @@ ImsMediaAudioPlayer::ImsMediaAudioPlayer() { mAudioStream = nullptr; mCodec = nullptr; + mFormat = nullptr; + mCodecType = 0; + mCodecMode = 0; mSamplingRate = DEFAULT_SAMPLING_RATE; + mEvsChAwOffset = 0; + mEvsBandwidth = kEvsBandwidthNone; + memset(mBuffer, 0, sizeof(mBuffer)); + mEvsBitRate = 0; mEvsCodecHeaderMode = kRtpPyaloadHeaderModeEvsHeaderFull; mIsFirstFrame = false; mIsEvsInitialized = false; |