Mixer controls that are in mixer_paths.xml but missing from
the mixer should be skipped, otherwise arrays will be accessed
out of bounds. This happened in b/
8893515.
Also print the missing control name to aid debugging.
Change-Id: Ia808df48734f78a02281408a4025652dec9762c0
else if (strcmp(tag_name, "ctl") == 0) {
/* Obtain the mixer ctl and value */
ctl = mixer_get_ctl_by_name(ar->mixer, attr_name);
+ if (ctl == NULL) {
+ ALOGE("Control '%s' doesn't exist - skipping", attr_name);
+ goto done;
+ }
+
switch (mixer_ctl_get_type(ctl)) {
case MIXER_CTL_TYPE_BOOL:
case MIXER_CTL_TYPE_INT:
}
}
+done:
state->level++;
}