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

Commit 3a6fa7fe authored by Leena Winterrowd's avatar Leena Winterrowd Committed by Arne Coucheron
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 3d11dc23
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -889,8 +889,9 @@ 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 &&
                        (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION || (adev->mode == AUDIO_MODE_IN_COMMUNICATION && adev->active_input->source == AUDIO_SOURCE_MIC))) &&
                if (((adev->active_input && adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION) ||
                     (adev->mode == AUDIO_MODE_IN_COMMUNICATION &&
                     (adev->active_input && adev->active_input->source == AUDIO_SOURCE_MIC))) &&
                        adev->primary_output && !adev->primary_output->standby) {
                    out_device = adev->primary_output->devices;
                } else if(usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {