Commit 9cf7f954 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

dsound: Lock the source buffer during duplication.

parent ab735065
......@@ -1083,9 +1083,15 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
*ppdsb = NULL;
return DSERR_OUTOFMEMORY;
}
RtlAcquireResourceShared(&pdsb->lock, TRUE);
CopyMemory(dsb, pdsb, sizeof(*dsb));
dsb->pwfx = DSOUND_CopyFormat(pdsb->pwfx);
RtlReleaseResource(&pdsb->lock);
if (dsb->pwfx == NULL) {
HeapFree(GetProcessHeap(),0,dsb);
*ppdsb = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment