aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2019-08-14 11:54:41 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2019-08-26 21:10:37 +0200
commitf86adf4bb5b40a2e8a255ad9eb064a5daea0bb6e (patch)
treeba70d4131e35e7b3379fa6ebbd7faa8fa8dc743a /src
parentb9fe47e85d138f8555cc9c821c50a94844024494 (diff)
Fixed an unitialized-buffer bug.
Diffstat (limited to 'src')
-rw-r--r--src/libsound/sound_alsa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsound/sound_alsa.c b/src/libsound/sound_alsa.c
index f2f123e..5b5e4eb 100644
--- a/src/libsound/sound_alsa.c
+++ b/src/libsound/sound_alsa.c
@@ -363,6 +363,9 @@ int sound_read(void *inst, sample_t **samples, int num, int channels, double *rf
int in, rc;
int i, ii;
+ /* make valgrind happy, because snd_pcm_readi() does not seem to initally fill buffer with values */
+ memset(buff, 0, sizeof(buff));
+
/* get samples in rx buffer */
in = snd_pcm_avail(sound->chandle);
/* if not more than KEEP_FRAMES frames available, try next time */