winealsa: Properly allocate the WAVEFORMATEXTENSIBLE returned by GetMixFormat.
This commit is contained in:
parent
c192041204
commit
d726cf8819
|
@ -1217,16 +1217,15 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
|
||||||
|
|
||||||
if(!pwfx)
|
if(!pwfx)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
*pwfx = NULL;
|
||||||
|
|
||||||
*pwfx = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEXTENSIBLE));
|
fmt = CoTaskMemAlloc(sizeof(WAVEFORMATEXTENSIBLE));
|
||||||
if(!*pwfx)
|
if(!fmt)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
fmt = (WAVEFORMATEXTENSIBLE*)*pwfx;
|
|
||||||
|
|
||||||
formats = HeapAlloc(GetProcessHeap(), 0, snd_pcm_format_mask_sizeof());
|
formats = HeapAlloc(GetProcessHeap(), 0, snd_pcm_format_mask_sizeof());
|
||||||
if(!formats){
|
if(!formats){
|
||||||
HeapFree(GetProcessHeap(), 0, *pwfx);
|
CoTaskMemFree(fmt);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1310,11 +1309,12 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
|
||||||
fmt->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
fmt->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||||
|
|
||||||
dump_fmt((WAVEFORMATEX*)fmt);
|
dump_fmt((WAVEFORMATEX*)fmt);
|
||||||
|
*pwfx = (WAVEFORMATEX*)fmt;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
LeaveCriticalSection(&This->lock);
|
LeaveCriticalSection(&This->lock);
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
HeapFree(GetProcessHeap(), 0, *pwfx);
|
CoTaskMemFree(fmt);
|
||||||
HeapFree(GetProcessHeap(), 0, formats);
|
HeapFree(GetProcessHeap(), 0, formats);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in New Issue