summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-07-19 17:42:09 +0200
committerTakashi Iwai <tiwai@suse.de>2010-07-19 17:42:09 +0200
commit8d011cc7a9374db9b5ace3b75d34f10fdc3b51c4 (patch)
tree6561bac3271ad8e46ed214bc92db362e1c56316a /sound/core
parentALSA: asihpi - Avoid useless assignment of returned index values. (diff)
parentALSA: pcm core - add a safe check to the silence filling function (diff)
downloadlinux-8d011cc7a9374db9b5ace3b75d34f10fdc3b51c4.tar.xz
linux-8d011cc7a9374db9b5ace3b75d34f10fdc3b51c4.zip
Merge branch 'devel' of git.alsa-project.org:alsa-kernel into topic/misc
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index bcf95d3ff5c7..e23e0e7ab26f 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -67,6 +67,8 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
} else {
if (new_hw_ptr == ULONG_MAX) { /* initialization */
snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime);
+ if (avail > runtime->buffer_size)
+ avail = runtime->buffer_size;
runtime->silence_filled = avail > 0 ? avail : 0;
runtime->silence_start = (runtime->status->hw_ptr +
runtime->silence_filled) %