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

Commit 74529457 authored by yidongh's avatar yidongh Committed by Gerrit - the friendly Code Review server
Browse files

hal: avoid dereferencing null pointer

Fix bug where null pointer may be dereferenced.

CRs-Fixed: 2043993
Change-Id: I5745a432155e858b4a680aca9363b8d76306f784
parent f28a5c3e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1522,6 +1522,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
            }
            }
        } else if (voice_extn_compress_voip_is_active(adev)) {
        } else if (voice_extn_compress_voip_is_active(adev)) {
            bool out_snd_device_backend_match = true;
            bool out_snd_device_backend_match = true;
            voip_usecase = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
            if (usecase->stream.out != NULL) {
            if (usecase->stream.out != NULL) {
                out_snd_device_backend_match = platform_check_backends_match(
                out_snd_device_backend_match = platform_check_backends_match(
                                                   voip_usecase->out_snd_device,
                                                   voip_usecase->out_snd_device,
@@ -1529,7 +1530,6 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
                                                       adev->platform,
                                                       adev->platform,
                                                       usecase->stream.out));
                                                       usecase->stream.out));
            }
            }
            voip_usecase = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
            if ((voip_usecase) && ((voip_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) &&
            if ((voip_usecase) && ((voip_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) &&
                ((usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) ||
                ((usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) ||
                  ((usecase->devices & ~AUDIO_DEVICE_BIT_IN) & AUDIO_DEVICE_IN_ALL_CODEC_BACKEND)) &&
                  ((usecase->devices & ~AUDIO_DEVICE_BIT_IN) & AUDIO_DEVICE_IN_ALL_CODEC_BACKEND)) &&