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

Commit a0108697 authored by James Dong's avatar James Dong
Browse files

Fixed a media server crash due to unintialized mRecord member variable

mRecord is not properly initialized if the call to AudioRecord::getMinFrameCount() fails.
media server crashes when the unintialized mRecord object is deleted in AudioSource's destructor.

Change-Id: Ia89222789d044c11c9957a99725bc89f9c709e17

related-to-bug: 6744014
parent af8e8aa1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ static void AudioRecordCallbackFunction(int event, void *user, void *info) {

AudioSource::AudioSource(
        audio_source_t inputSource, uint32_t sampleRate, uint32_t channelCount)
    : mStarted(false),
    : mRecord(NULL),
      mStarted(false),
      mSampleRate(sampleRate),
      mPrevSampleTimeUs(0),
      mNumFramesReceived(0),