[PATCH 0/1] MR11162: winmm: Avoid loop counter underflow when dwLoops is 0.
dwFlags = WHDR_BEGINLOOP|WHDR_ENDLOOP with dwLoops 0 underflowed loop_counter to 0xffffffff, so the buffer was never finished and playback looped forever. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59874 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11162
From: Ned Son <nedsociety@gmail.com> dwFlags = WHDR_BEGINLOOP|WHDR_ENDLOOP with dwLoops 0 underflowed loop_counter to 0xffffffff, so the buffer was never finished and playback looped forever. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59874 --- dlls/winmm/waveform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c index 5b9134da696..e3a4f5faca9 100644 --- a/dlls/winmm/waveform.c +++ b/dlls/winmm/waveform.c @@ -1570,8 +1570,7 @@ static void WOD_PushData(WINMM_Device *device) device->loop_counter = queue->dwLoops; } if(queue->dwFlags & WHDR_ENDLOOP){ - --device->loop_counter; - if(device->loop_counter) + if(device->loop_counter && --device->loop_counter) device->playing = device->loop_start; else device->loop_start = device->playing = queue->lpNext; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11162
participants (2)
-
Myungbae Son (@nedsociety) -
Ned Son