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

Commit 539588b4 authored by Satya Krishna Pindiproli's avatar Satya Krishna Pindiproli Committed by Gerrit - the friendly Code Review server
Browse files

hal: add NULL check for stream in

Add a null check for stream in to avoid crashes during
voice call recording and other use cases which involve
capture path.

CRs-Fixed: 2010691
Change-Id: Ifc23bb837804d9500a1b9c5164f79fa085b20a34
parent 5c04cc3a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5495,9 +5495,9 @@ static bool platform_check_capture_codec_backend_cfg(struct audio_device* adev,
        /* update cfg against other existing capture usecases on same backend */
        list_for_each(node, &adev->usecase_list) {
            uc = node_to_item(node, struct audio_usecase, list);
            if (uc->type == PCM_CAPTURE &&
                backend_idx == platform_get_backend_index(uc->in_snd_device)) {
            in = (struct stream_in *) uc->stream.in;
            if (in != NULL && uc->type == PCM_CAPTURE &&
                backend_idx == platform_get_backend_index(uc->in_snd_device)) {
                uc_channels = audio_channel_count_from_in_mask(in->channel_mask);

                ALOGV("%s:txbecf: uc %s, id %d, sr %d, bw %d, ch %d, device %s",
+2 −2
Original line number Diff line number Diff line
@@ -5360,9 +5360,9 @@ static bool platform_check_capture_codec_backend_cfg(struct audio_device* adev,
        /* update cfg against other existing capture usecases on same backend */
        list_for_each(node, &adev->usecase_list) {
            uc = node_to_item(node, struct audio_usecase, list);
            if (uc->type == PCM_CAPTURE &&
                backend_idx == platform_get_backend_index(uc->in_snd_device)) {
            in = (struct stream_in *) uc->stream.in;
            if (in != NULL && uc->type == PCM_CAPTURE &&
                backend_idx == platform_get_backend_index(uc->in_snd_device)) {
                uc_channels = audio_channel_count_from_in_mask(in->channel_mask);

                ALOGV("%s:txbecf: uc %s, id %d, sr %d, bw %d, ch %d, device %s",