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

Commit b8d55fdc authored by Ashish Jain's avatar Ashish Jain Committed by Gerrit - the friendly Code Review server
Browse files

hal: Fix crash during voice call

-Validate active_input before accessing it, it NULL use
default value.
-For voice call scenario it is not necessary to have an active
input stream.

Change-Id: I258b9e8c098d76f838bcca5b968d64369243885e
parent c5fefba2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3456,7 +3456,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
                                AUDIO_CHANNEL_IN_MONO : adev->active_input->channel_mask;
    snd_device_t snd_device = SND_DEVICE_NONE;
    int channel_count = popcount(channel_mask);
    int str_bitwidth = adev->active_input->bit_width;
    int str_bitwidth = (adev->active_input == NULL) ?
                    CODEC_BACKEND_DEFAULT_BIT_WIDTH : adev->active_input->bit_width;

    ALOGV("%s: enter: out_device(%#x) in_device(%#x) channel_count (%d) channel_mask (0x%x)",
          __func__, out_device, in_device, channel_count, channel_mask);
+2 −1
Original line number Diff line number Diff line
@@ -3098,7 +3098,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
                                AUDIO_CHANNEL_IN_MONO : adev->active_input->channel_mask;
    snd_device_t snd_device = SND_DEVICE_NONE;
    int channel_count = popcount(channel_mask);
    int str_bitwidth = adev->active_input->bit_width;
    int str_bitwidth = (adev->active_input == NULL) ?
                 CODEC_BACKEND_DEFAULT_BIT_WIDTH : adev->active_input->bit_width;

    ALOGV("%s: enter: out_device(%#x) in_device(%#x) channel_count (%d) channel_mask (0x%x)",
          __func__, out_device, in_device, channel_count, channel_mask);