aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2015-08-25 12:47:13 -0700
committerGlenn Kasten <gkasten@google.com>2015-09-02 10:33:03 -0700
commite4f8a5b2859001bc8765435539c64bdf602b466e (patch)
tree3b9bb0fa0d93f00617f2bfbc30951966f7804635
parent38f87f3be4f397d796a558555ee3218e18cd793b (diff)
initialize pcm_config to zero
sw_params ioctl() is failing with 'invalid parameter' error since pointer to pcm_config passed from tinyplay is not zero initialized, hence invalid values are passed for some parameters. authored-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org> Bug: 23525433 Change-Id: I841f29c82ec3fb7646ad8c47fca25963b5f77945
-rw-r--r--tinycap.c1
-rw-r--r--tinyplay.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/tinycap.c b/tinycap.c
index be289d4..90b37cd 100644
--- a/tinycap.c
+++ b/tinycap.c
@@ -174,6 +174,7 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device,
unsigned int size;
unsigned int bytes_read = 0;
+ memset(&config, 0, sizeof(config));
config.channels = channels;
config.rate = rate;
config.period_size = period_size;
diff --git a/tinyplay.c b/tinyplay.c
index f4fac9f..88c54ae 100644
--- a/tinyplay.c
+++ b/tinyplay.c
@@ -218,6 +218,7 @@ void play_sample(FILE *file, unsigned int card, unsigned int device, unsigned in
int size;
int num_read;
+ memset(&config, 0, sizeof(config));
config.channels = channels;
config.rate = rate;
config.period_size = period_size;