Module: wine Branch: master Commit: 6d3e784d5711ba705c5b2cd165097d64761291cc URL: http://source.winehq.org/git/wine.git/?a=commit;h=6d3e784d5711ba705c5b2cd165...
Author: Andrew Eikum aeikum@codeweavers.com Date: Wed Jan 25 11:14:36 2012 -0600
wineoss.drv: Fix buffer offset calculation.
---
dlls/wineoss.drv/mmdevdrv.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 0900231..650c46d 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -1825,7 +1825,6 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, if(This->lcl_offs_frames + *frames > This->bufsize_frames){ UINT32 chunk_bytes, offs_bytes, frames_bytes; if(This->tmp_buffer_frames < *frames){ - if(This->tmp_buffer) HeapFree(GetProcessHeap(), 0, This->tmp_buffer); This->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, *frames * This->fmt->nBlockAlign); @@ -1842,7 +1841,7 @@ static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, offs_bytes = This->lcl_offs_frames * This->fmt->nBlockAlign; frames_bytes = *frames * This->fmt->nBlockAlign; memcpy(This->tmp_buffer, This->local_buffer + offs_bytes, chunk_bytes); - memcpy(This->tmp_buffer, This->local_buffer, + memcpy(This->tmp_buffer + chunk_bytes, This->local_buffer, frames_bytes - chunk_bytes); }else *data = This->local_buffer +