Merge "ma_listener: correct bounds of array" into pi-dev
diff --git a/post_proc/ma_listener.c b/post_proc/ma_listener.c
index 8e57db1..02d45d3 100644
--- a/post_proc/ma_listener.c
+++ b/post_proc/ma_listener.c
@@ -61,7 +61,7 @@
static const audio_stream_type_t MIN_STREAM_TYPES = AUDIO_STREAM_VOICE_CALL;
static const audio_stream_type_t MAX_STREAM_TYPES = AUDIO_STREAM_NOTIFICATION;
-static struct ma_state g_cur_state[MAX_STREAM_TYPES];
+static struct ma_state g_cur_state[MAX_STREAM_TYPES + 1];
struct ma_listener_context_s {
const struct effect_interface_s *itfe;
@@ -211,6 +211,8 @@
else if (max_vol > 1.0) max_vol = 1.0;
if (send_ma_parameter != NULL &&
+ stream_type >= MIN_STREAM_TYPES &&
+ stream_type <= MAX_STREAM_TYPES &&
(g_cur_state[stream_type].vol != max_vol ||
g_cur_state[stream_type].active != active)) {