]> Repos - portaudio/commitdiff
wasapi:
authordmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Thu, 16 Feb 2012 15:02:08 +0000 (15:02 +0000)
committerdmitrykos <dmitrykos@0f58301d-fd10-0410-b4af-bbb618454e57>
Thu, 16 Feb 2012 15:02:08 +0000 (15:02 +0000)
- 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

index a6bafdddc6ccf338592ce2ade8a9a7600ce4bd98..279b5fb0b65dbf7f78180b2adaf002dc1b8adc9e 100644 (file)
@@ -4799,13 +4799,15 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
                                        // output\r
                                        if (stream->bufferMode == paUtilFixedHostBufferSize)\r
                                        {\r
-                                               if (frames >= stream->out.framesPerBuffer)\r
+                                               while (frames >= stream->out.framesPerBuffer)\r
                                                {\r
                                                        if ((hr = ProcessOutputBuffer(stream, processor, stream->out.framesPerBuffer)) != S_OK)\r
                                                        {\r
                                                                LogHostError(hr);\r
                                                                goto thread_error;\r
                                                        }\r
+\r
+                                                       frames -= stream->out.framesPerBuffer;\r
                                                }\r
                                        }\r
                                        else\r