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

Commit 0791c8e6 authored by Weiyin Jiang's avatar Weiyin Jiang Committed by Gerrit - the friendly Code Review server
Browse files

hal: add usecase type check

Add usecase type check to avoid stream.out being dereferenced in pcm
capture case.

CRs-Fixed: 2494182
Change-Id: I39ca104e8d34e76d4ff5cdb6177faddea04f6d96
parent 5171705a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2801,6 +2801,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
              !(usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
              (usecase->type != TRANSCODE_LOOPBACK_TX) &&
              (usecase->type != TRANSCODE_LOOPBACK_RX) &&
              (usecase->type != PCM_CAPTURE) &&
              usecase->stream.out->started) {
              if (is_bt_soc_on(adev) == false) {
                  ALOGD("BT SCO/A2dp disconnected while in connection");