mirror of
https://github.com/reactos/wine.git
synced 2024-11-30 15:10:27 +00:00
wineoss: Properly allocate the WAVEFORMATEXTENSIBLE returned by GetMixFormat.
This commit is contained in:
parent
8337ffb727
commit
f68a36c87b
@ -1025,12 +1025,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
|
||||
|
||||
if(!pwfx)
|
||||
return E_POINTER;
|
||||
|
||||
*pwfx = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEXTENSIBLE));
|
||||
if(!*pwfx)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
fmt = (WAVEFORMATEXTENSIBLE*)*pwfx;
|
||||
*pwfx = NULL;
|
||||
|
||||
if(This->dataflow == eRender)
|
||||
formats = This->ai.oformats;
|
||||
@ -1039,6 +1034,10 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
|
||||
else
|
||||
return E_UNEXPECTED;
|
||||
|
||||
fmt = CoTaskMemAlloc(sizeof(WAVEFORMATEXTENSIBLE));
|
||||
if(!fmt)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
fmt->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
if(formats & AFMT_S16_LE){
|
||||
fmt->Format.wBitsPerSample = 16;
|
||||
@ -1059,6 +1058,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
|
||||
fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
||||
}else{
|
||||
ERR("Didn't recognize any available OSS formats: %x\n", formats);
|
||||
CoTaskMemFree(fmt);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@ -1074,6 +1074,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
|
||||
fmt->Samples.wValidBitsPerSample = fmt->Format.wBitsPerSample;
|
||||
fmt->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
|
||||
*pwfx = (WAVEFORMATEX*)fmt;
|
||||
dump_fmt(*pwfx);
|
||||
|
||||
return S_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user