audio: hal: Fix incorrect boundary check for intereactive audio

Fix incorrect boundary check for pan/scale/downmix controls.
Fix be_id being overridden because of incorrect indexing.

Change-Id: I96a2919a0a3df18a0cbaed48f27c1be43cdc68c8
CRs-fixed: 2091555
diff --git a/hal/audio_extn/passthru.c b/hal/audio_extn/passthru.c
index 63f4d92..f70d8ea 100644
--- a/hal/audio_extn/passthru.c
+++ b/hal/audio_extn/passthru.c
@@ -424,7 +424,10 @@
         return false;
     }
 
-    if ((out != NULL) && (out->compr_config.codec->compr_passthr == PASSTHROUGH || out->compr_config.codec->compr_passthr == PASSTHROUGH_IEC61937))
+    if ((out != NULL) &&
+        (out->compr_config.codec != NULL) &&
+        (out->compr_config.codec->compr_passthr == PASSTHROUGH ||
+         out->compr_config.codec->compr_passthr == PASSTHROUGH_IEC61937))
         return true;
     else
         return false;
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index a993d76..130a6e2 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -2330,9 +2330,11 @@
 
     out->downmix_params.has_mixer_coeffs = mm_params->has_mixer_coeffs;
     for (i = 0; i < mm_params->num_output_channels; i++)
-        for (j = 0; j < mm_params->num_input_channels; j++)
+        for (j = 0; j < mm_params->num_input_channels; j++) {
+            //Convert the channel coefficient gains in Q14 format
             out->downmix_params.mixer_coeffs[i][j] =
-                               mm_params->mixer_coeffs[i][j];
+                               mm_params->mixer_coeffs[i][j] * (2 << 13);
+    }
 
     ret = platform_set_stream_downmix_params(out->dev->platform,
                                              out->pcm_device_id,