aboutsummaryrefslogtreecommitdiff
path: root/audio/dsoundaudio.c
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2020-04-05 09:50:17 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-04-06 13:29:53 +0200
commit8d1439b692c5dc8edc4d4a1d334afd7070458029 (patch)
tree17b273228418b880c09ecfbda53b58bc20fb848a /audio/dsoundaudio.c
parent174702986c04180e0c05cddbaf6b2547a07310eb (diff)
dsoundaudio: dsound_get_buffer_in should honor *size
This patch prevents an underflow of variable samples in function audio_pcm_hw_run_in(). See commit 599eac4e5a "audio: audio_generic_get_buffer_in should honor *size". This time the while loop in audio_pcm_hw_run_in() will terminate nevertheless, because it seems the recording stream in Windows is always rate limited. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Message-id: 20200405075017.9901-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/dsoundaudio.c')
-rw-r--r--audio/dsoundaudio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index a08d519cae..4cdf19ab67 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -540,7 +540,7 @@ static void *dsound_get_buffer_in(HWVoiceIn *hw, size_t *size)
}
req_size = audio_ring_dist(cpos, hw->pos_emul, hw->size_emul);
- req_size = MIN(req_size, hw->size_emul - hw->pos_emul);
+ req_size = MIN(*size, MIN(req_size, hw->size_emul - hw->pos_emul));
if (req_size == 0) {
*size = 0;