hal: fix null pointer de-reference

When speaker protection is turned on input stream can be
NULL. Add a check to fix de-referencing NULL pointer.

Change-Id: I75647d9360a559b5255c29d0baca264b1274eba2
diff --git a/hal/voice.c b/hal/voice.c
index cf5ec65..5fb0956 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -222,6 +222,11 @@
 {
     bool in_call_rec = false;
 
+    if (!in) {
+       ALOGE("%s: input stream is NULL", __func__);
+       return in_call_rec;
+    }
+
     if(in->source == AUDIO_SOURCE_VOICE_DOWNLINK ||
        in->source == AUDIO_SOURCE_VOICE_UPLINK ||
        in->source == AUDIO_SOURCE_VOICE_CALL) {