From: dmitrykos Date: Thu, 16 Feb 2012 15:02:08 +0000 (+0000) Subject: wasapi: X-Git-Tag: pa_stable_v19_20140130_r1919~85 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=341eb04550aab36ed22fa39a803746ba2948aa15;p=portaudio 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) --- 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