hal: add NULL check for active input stream
Check active input stream is valid or not before accessing
the input stream member variables.
Change-Id: Ibd0fdcccedbec988e917079c4b62ef286f56c58f
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 3152669..6197b28 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2275,7 +2275,8 @@
/* If input stream is already running then effect needs to be
applied on the new input device that's being enabled here. */
- if ((in_snd_device != SND_DEVICE_NONE) && (!adev->active_input->standby))
+ if ((in_snd_device != SND_DEVICE_NONE) && (adev->active_input != NULL) &&
+ (!adev->active_input->standby))
check_and_enable_effect(adev);
if (usecase->type == VOICE_CALL || usecase->type == VOIP_CALL) {