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

Commit 57ccfe17 authored by jiabin's avatar jiabin Committed by Rohit Yengisetty
Browse files

Init gain config to prevent uninit leak.

In AudioPortConfig, we only initialize index for audio_gain_config, but
not other fields. That may cause uninit leak at listAudioPorts and
listAudioPatches.

Bug: 77238250
Bug: 77238762
Test: try repo steps at the bug description.
Change-Id: I57e3bd0598f9aa698a6fa3d3c0218b046de34e2f
(cherry picked from commit ebe0777e)
parent 3ec5b395
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -385,6 +385,7 @@ AudioPortConfig::AudioPortConfig()
    mSamplingRate = 0;
    mSamplingRate = 0;
    mChannelMask = AUDIO_CHANNEL_NONE;
    mChannelMask = AUDIO_CHANNEL_NONE;
    mFormat = AUDIO_FORMAT_INVALID;
    mFormat = AUDIO_FORMAT_INVALID;
    memset(&mGain, 0, sizeof(struct audio_gain_config));
    mGain.index = -1;
    mGain.index = -1;
}
}