From 341eb04550aab36ed22fa39a803746ba2948aa15 Mon Sep 17 00:00:00 2001 From: dmitrykos Date: Thu, 16 Feb 2012 15:02:08 +0000 Subject: [PATCH] wasapi: - fixed possible buffer overrun inside WASAPI for Output poll-driven mode according ticket #196 (thanks to Ross Bencina for spotting this and proposing the solution) --- src/hostapi/wasapi/pa_win_wasapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c index a6bafdd..279b5fb 100644 --- a/src/hostapi/wasapi/pa_win_wasapi.c +++ b/src/hostapi/wasapi/pa_win_wasapi.c @@ -4799,13 +4799,15 @@ PA_THREAD_FUNC ProcThreadPoll(void *param) // output if (stream->bufferMode == paUtilFixedHostBufferSize) { - if (frames >= stream->out.framesPerBuffer) + while (frames >= stream->out.framesPerBuffer) { if ((hr = ProcessOutputBuffer(stream, processor, stream->out.framesPerBuffer)) != S_OK) { LogHostError(hr); goto thread_error; } + + frames -= stream->out.framesPerBuffer; } } else -- 2.43.0