From b7118753f41832fe40a0e3f75b123f51e7364ba8 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Mon, 19 Dec 2016 14:17:23 -0700 Subject: [PATCH] dsound: Clear the temporary mixing buffer after allocation. Signed-off-by: Erich E. Hoover Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/dsound/mixer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 309c338cd10..25507539be3 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -428,6 +428,8 @@ static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames) else dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, size_bytes); } + if(dsb->put_aux == putieee32_sum) + memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len); cp_fields(dsb, frames, &dsb->freqAccNum); @@ -506,9 +508,6 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, float *mix_buffer, /* Resample buffer to temporary buffer specifically allocated for this purpose, if needed */ oldpos = dsb->sec_mixpos; - - if(dsb->put_aux == putieee32_sum) - memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len); DSOUND_MixToTemporary(dsb, frames); ibuf = dsb->device->tmp_buffer;