diff options
author | Leena Winterrowd <lenhardw@codeaurora.org> | 2016-01-12 15:05:53 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-04-27 20:46:30 -0700 |
commit | d25d8532d698a5e53352a27c66b005e41bfa384f (patch) | |
tree | 52720b5ef620bc3ff9b9dc3a278ea35b847319d6 | |
parent | 09eeea9f7342de46df1a539a9ef846a13c34a765 (diff) | |
download | hardware_qcom_audio-d25d8532d698a5e53352a27c66b005e41bfa384f.tar.gz hardware_qcom_audio-d25d8532d698a5e53352a27c66b005e41bfa384f.tar.bz2 hardware_qcom_audio-d25d8532d698a5e53352a27c66b005e41bfa384f.zip |
hal: Validate active input before accessing source
Ensure that the audio device's active input is valid before
attempting to access the input source.
CRs-Fixed: 959009
Change-Id: If66cc1e3d5467bf7d03137fdbbffd724a57ecaf6
-rw-r--r-- | hal/audio_hw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 7aa34ca2..7d1cf280 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1000,7 +1000,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) out_snd_device = SND_DEVICE_NONE; if (in_snd_device == SND_DEVICE_NONE) { audio_devices_t out_device = AUDIO_DEVICE_NONE; - if (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION && + if (adev->active_input && + adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION && adev->primary_output && !adev->primary_output->standby) { out_device = adev->primary_output->devices; platform_set_echo_reference(adev->platform, false); |