summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSharad Sangle <assangle@codeaurora.org>2015-12-10 18:39:17 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2015-12-10 17:52:35 -0800
commit3a44f582d97f9583403cde215f3e19a95dab2bec (patch)
tree6ce842e9e97dd3dac210c043a2a3d95786371253
parent16ec18dd4d5b144e0b549e7cade3f2669e38c175 (diff)
downloadandroid_hardware_qcom_audio-3a44f582d97f9583403cde215f3e19a95dab2bec.tar.gz
android_hardware_qcom_audio-3a44f582d97f9583403cde215f3e19a95dab2bec.tar.bz2
android_hardware_qcom_audio-3a44f582d97f9583403cde215f3e19a95dab2bec.zip
HAL: Identify the track offload session
The current logic for identifying the track offload session is using strlcat in wrong way, third parameter is given the string length to be appended, but in fact it should be the size of the destination buffer. Due to this the string returned is missing the last character, in case of "true", it contains "tru" due this the session is not considered as a track offload by the calling module. To fix this use sizeof of the destination buffer instead of string length of string to be appended. Change-Id: I3d456aad2ca49095a0dfe5883f4374e22a437256 CRs-Fixed: 946670
-rw-r--r--hal/audio_hw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 45b8095f..08df4624 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2033,10 +2033,10 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k
value[0] = '\0';
if (out->flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM) {
ALOGV("in direct_pcm");
- strlcat(value, "true", strlen("true"));
+ strlcat(value, "true", sizeof(value ));
} else {
ALOGV("not in direct_pcm");
- strlcat(value, "false", strlen("false"));
+ strlcat(value, "false", sizeof(value));
}
str_parms_add_str(reply, "is_direct_pcm_track", value);
str = str_parms_to_str(reply);