[PATCH v2 5/7] quartz/waveparser: Always allocate at least a WAVEFORMATEX for the source media type.
Zebediah Figura
z.figura12 at gmail.com
Tue Mar 5 10:56:59 CST 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/quartz/waveparser.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c
index 2ea3dc0427..1c3447fe43 100644
--- a/dlls/quartz/waveparser.c
+++ b/dlls/quartz/waveparser.c
@@ -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;
--
2.20.1
More information about the wine-devel
mailing list