summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDivya Sharma <c_shard@codeaurora.org>2013-11-02 21:36:11 +0200
committerLinux Build Service Account <lnxbuild@localhost>2014-11-04 08:50:19 -0700
commita6ec737fff364477e7e93543d18f51bb17bd8799 (patch)
tree24ba00515cad51efef2690f9b9dc4558801a4463
parent6acbdabf4cd7017583ababb81ed0874237334be3 (diff)
downloadandroid_system_media-staging/cm-12.0-caf.tar.gz
android_system_media-staging/cm-12.0-caf.tar.bz2
android_system_media-staging/cm-12.0-caf.zip
Nullify non-initialized entries in the mixer control structurestaging/cm-12.0-caf
While initialization process of some internal control structure, some entries can remain non-initialized. To avoid possible crash while the structure release, the non-initialized entries should be zeroed. Change-Id: I2450c9214eeb478cc57feef706d00b10c6897b60
-rw-r--r--audio_route/audio_route.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/audio_route/audio_route.c b/audio_route/audio_route.c
index 029951c1..c14cbf98 100644
--- a/audio_route/audio_route.c
+++ b/audio_route/audio_route.c
@@ -493,8 +493,12 @@ static int alloc_mixer_state(struct audio_route *ar)
/* Skip unsupported types that are not supported yet in XML */
type = mixer_ctl_get_type(ctl);
- if (!is_supported_ctl_type(type))
+ if (!is_supported_ctl_type(type)) {
+ ar->mixer_state[i].old_value = NULL;
+ ar->mixer_state[i].new_value = NULL;
+ ar->mixer_state[i].reset_value = NULL;
continue;
+ }
ar->mixer_state[i].old_value = malloc(num_values * sizeof(int));
ar->mixer_state[i].new_value = malloc(num_values * sizeof(int));