summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-04-04 00:52:23 -0700
committerLinux Build Service Account <lnxbuild@localhost>2016-04-04 00:52:23 -0700
commiteb09e82b3a5d75fdd8b1f359fd607bc7a0c9ef88 (patch)
tree6358c6a11ad6e8d76777fb671c38efe5ab3af93d
parent492b2fe6d50c0d6b6808ef5be769044b54ce2a83 (diff)
parent0d92129d7299ee88e7ecc924b3493360e2f084e7 (diff)
downloadandroid_hardware_qcom_audio-eb09e82b3a5d75fdd8b1f359fd607bc7a0c9ef88.tar.gz
android_hardware_qcom_audio-eb09e82b3a5d75fdd8b1f359fd607bc7a0c9ef88.tar.bz2
android_hardware_qcom_audio-eb09e82b3a5d75fdd8b1f359fd607bc7a0c9ef88.zip
Promotion of av-userspace.lnx.1.0.c2-00001.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 989491 I09d35977c9c3abf5819d5c72506c8d157158e212 hal : Fix data initialization and input validation error Change-Id: Ibc4b625228cebf740237229d6b36057885eed6ab CRs-Fixed: 989491
-rw-r--r--hal/audio_extn/spkr_protection.c1
-rw-r--r--hal/msm8916/platform.c26
-rw-r--r--post_proc/bundle.c4
3 files changed, 18 insertions, 13 deletions
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index 1335ee97..44ff952d 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -421,6 +421,7 @@ static int spkr_calibrate(int t0_spk_1, int t0_spk_2)
struct timespec ts;
bool acquire_device = false;
+ status.status = 0;
if (!adev) {
ALOGE("%s: Invalid params", __func__);
return -EINVAL;
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index fe502dac..923135ee 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -1311,14 +1311,14 @@ static void set_platform_defaults()
if(property_get_bool("use.qti.sw.alac.decoder", false)) {
ALOGD("Alac software decoder is available...removing alac from DSP decoder list");
- strncpy(dsp_only_decoders_mime[count],"none",5);
+ strlcpy(dsp_only_decoders_mime[count],"none",5);
}
} else if (!strncmp(MEDIA_MIMETYPE_AUDIO_APE, dsp_only_decoders_mime[count],
strlen(dsp_only_decoders_mime[count]))) {
if(property_get_bool("use.qti.sw.ape.decoder", false)) {
ALOGD("APE software decoder is available...removing ape from DSP decoder list");
- strncpy(dsp_only_decoders_mime[count],"none",5);
+ strlcpy(dsp_only_decoders_mime[count],"none",5);
}
}
}
@@ -1445,7 +1445,7 @@ static void send_codec_cal(acdb_loader_get_calibration_t acdb_loader_get_calibra
sizeof(struct param_data), &calib);
if (ret < 0) {
ALOGE("%s get_calibration failed type=%s calib.size=%d\n"
- , __func__, cal_name_info[type], codec_buffer.size);
+ , __func__, cal_name_info[type], calib.buff_size);
free(calib.buff);
continue;
}
@@ -1619,13 +1619,14 @@ static bool check_and_get_wsa_info(char *snd_card_name, int *wsaCount,
/* update wsa combo supported flag based on sound card name */
/* wsa combo flag needs to be set to true only for hardware
combinations which has support for both wsa and non-wsa speaker */
- if (snd_card_name && ((!strncmp(snd_card_name, "msm8953-snd-card-mtp",
- sizeof("msm8953-snd-card-mtp"))) ||
- (!strncmp(snd_card_name, "msm8952-skum-snd-card",
- sizeof("msm8952-skum-snd-card"))))) {
- *is_wsa_combo_supported = true;
- } else {
- *is_wsa_combo_supported = false;
+ *is_wsa_combo_supported = false;
+ if(snd_card_name) {
+ if ((!strncmp(snd_card_name, "msm8953-snd-card-mtp",
+ sizeof("msm8953-snd-card-mtp")) ||
+ (!strncmp(snd_card_name, "msm8952-skum-snd-card",
+ sizeof("msm8952-skum-snd-card"))))) {
+ *is_wsa_combo_supported = true;
+ }
}
}
closedir(tdir);
@@ -2306,11 +2307,14 @@ void native_audio_get_params(struct str_parms *query,
int native_audio_set_params(struct platform_data *platform,
struct str_parms *parms, char *value, int len)
{
- int ret = 0;
+ int ret = -1;
struct audio_usecase *usecase;
struct listnode *node;
int mode = NATIVE_AUDIO_MODE_INVALID;
+ if (!value)
+ return ret;
+
ret = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_NATIVE_AUDIO_MODE,
value, len);
if (ret >= 0) {
diff --git a/post_proc/bundle.c b/post_proc/bundle.c
index 2bc7fad1..d39a8b72 100644
--- a/post_proc/bundle.c
+++ b/post_proc/bundle.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -287,7 +287,7 @@ exit:
__attribute__ ((visibility ("default")))
int offload_effects_bundle_hal_stop_output(audio_io_handle_t output, int pcm_id)
{
- int ret;
+ int ret = -1;
struct listnode *node;
struct listnode *fx_node;
output_context_t *out_ctxt;