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

Commit 114bce2c authored by Leena Winterrowd's avatar Leena Winterrowd
Browse files

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
parent 80f4a45a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -870,7 +870,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);