dsound: Allow enough space for multi-channel frames.

Huw Davies huw at codeweavers.com
Tue Feb 28 07:37:53 CST 2017


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/dsound/primary.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index b10ba02..87b7e8e 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -240,7 +240,7 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device, WAVEFORMATEX *wfx,
     /* reallocate emulated primary buffer */
     if (forcewave || !mixfloat) {
         if (!forcewave)
-            new_buflen = frames * sizeof(float);
+            new_buflen = frames * wfx->nChannels * sizeof(float);
 
         if (device->buffer)
             newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, new_buflen);
-- 
2.10.2




More information about the wine-patches mailing list