diff options
author | Haynes Mathew George <hgeorge@codeaurora.org> | 2015-08-25 12:47:13 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2015-09-02 10:33:03 -0700 |
commit | e4f8a5b2859001bc8765435539c64bdf602b466e (patch) | |
tree | 3b9bb0fa0d93f00617f2bfbc30951966f7804635 | |
parent | 38f87f3be4f397d796a558555ee3218e18cd793b (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.c | 1 | ||||
-rw-r--r-- | tinyplay.c | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -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; @@ -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; |