quartz/waveparser: Always allocate at least a WAVEFORMATEX for the source media type.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-03-05 10:56:59 -06:00 committed by Alexandre Julliard
parent ec7419fc78
commit c0c58761e7
1 changed files with 3 additions and 2 deletions

View File

@ -287,10 +287,11 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
amt.majortype = MEDIATYPE_Audio;
amt.formattype = FORMAT_WaveFormatEx;
amt.cbFormat = chunk.cb;
amt.cbFormat = max(chunk.cb, sizeof(WAVEFORMATEX));
amt.pbFormat = CoTaskMemAlloc(amt.cbFormat);
memset(amt.pbFormat, 0, amt.cbFormat);
amt.pUnk = NULL;
IAsyncReader_SyncRead(This->pReader, pos, amt.cbFormat, amt.pbFormat);
IAsyncReader_SyncRead(This->pReader, pos, chunk.cb, amt.pbFormat);
amt.subtype = MEDIATYPE_Audio;
amt.subtype.Data1 = ((WAVEFORMATEX*)amt.pbFormat)->wFormatTag;