Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2013-05-26 18:29:29 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2013-06-23 17:27:42 +0400
commite24ab62e1cefe4f73fe259fbf225fa14a948a188 (patch)
tree25605fffcf2470f4fb30e534caa76898b4f2c400
parentad972ce4f3a448ea45198230d2ff2668d675f6c8 (diff)
Replace memset with ZeroMemory.
The ZeroMemory macro makes clear what it does compared to `memset(foo, 0, bar)`.
-rw-r--r--include/moreuuids.h4
-rw-r--r--src/DSUtil/DSUtil.cpp14
-rw-r--r--src/DSUtil/HdmvClipInfo.h2
-rw-r--r--src/DSUtil/NullRenderers.cpp2
-rw-r--r--src/DSUtil/WinAPIUtils.cpp4
-rw-r--r--src/DSUtil/text.cpp4
-rw-r--r--src/DeCSS/DeCSSInputPin.cpp10
-rw-r--r--src/DeCSS/udf.cpp2
-rw-r--r--src/MPCTestAPI/MPCTestAPIDlg.cpp2
-rw-r--r--src/SubPic/DX9SubPic.cpp40
-rw-r--r--src/Subtitles/CCDecoder.cpp10
-rw-r--r--src/Subtitles/DVBSub.h2
-rw-r--r--src/Subtitles/HdmvSub.h12
-rw-r--r--src/Subtitles/RTS.cpp12
-rw-r--r--src/Subtitles/Rasterizer.cpp4
-rw-r--r--src/Subtitles/STS.cpp4
-rw-r--r--src/Subtitles/VobSubFile.cpp6
-rw-r--r--src/Subtitles/VobSubFileRipper.cpp4
-rw-r--r--src/Subtitles/VobSubImage.cpp4
-rw-r--r--src/filters/InternalPropertyPage.cpp2
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp2
-rw-r--r--src/filters/parser/AviSplitter/AviFile.cpp8
-rw-r--r--src/filters/parser/AviSplitter/AviFile.h4
-rw-r--r--src/filters/parser/AviSplitter/AviSplitter.cpp8
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitter.cpp4
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp70
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitterFileEx.h4
-rw-r--r--src/filters/parser/FLVSplitter/FLVSplitter.cpp10
-rw-r--r--src/filters/parser/MP4Splitter/MP4Splitter.cpp20
-rw-r--r--src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp32
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitter.cpp8
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitterFile.cpp6
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitterFile.h2
-rw-r--r--src/filters/parser/OggSplitter/OggFile.cpp2
-rw-r--r--src/filters/parser/OggSplitter/OggFile.h2
-rw-r--r--src/filters/parser/OggSplitter/OggSplitter.cpp12
-rw-r--r--src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp18
-rw-r--r--src/filters/reader/CDDAReader/CDDAReader.cpp8
-rw-r--r--src/filters/reader/CDXAReader/CDXAReader.cpp2
-rw-r--r--src/filters/reader/UDPReader/UDPReader.cpp6
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/D3DFont.cpp2
-rw-r--r--src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp2
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp9
-rw-r--r--src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp18
-rw-r--r--src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp9
-rw-r--r--src/filters/renderer/VideoRenderers/IPinHook.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp12
-rw-r--r--src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp10
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.cpp40
-rw-r--r--src/filters/source/D2VSource/D2VSource.cpp2
-rw-r--r--src/filters/source/FLACSource/FLACSource.cpp2
-rw-r--r--src/filters/source/FLICSource/FLICSource.cpp6
-rw-r--r--src/filters/source/ShoutcastSource/ShoutcastSource.cpp5
-rw-r--r--src/filters/source/SubtitleSource/SubtitleSource.cpp12
-rw-r--r--src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp6
-rw-r--r--src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp6
-rw-r--r--src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp12
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoder.cpp16
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp12
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp6
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp8
-rw-r--r--src/filters/transform/MPCVideoDec/FfmpegContext.cpp2
-rw-r--r--src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp6
-rw-r--r--src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp2
-rw-r--r--src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp4
-rw-r--r--src/filters/transform/MpaDecFilter/MpaDecFilter.cpp12
-rw-r--r--src/filters/transform/MpaDecFilter/PaddedArray.h4
-rw-r--r--src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h8
-rw-r--r--src/filters/transform/VSFilter/DirectVobSubFilter.cpp8
-rw-r--r--src/mpc-hc/AppSettings.cpp4
-rw-r--r--src/mpc-hc/FGManager.cpp4
-rw-r--r--src/mpc-hc/FileAssoc.cpp12
-rw-r--r--src/mpc-hc/MainFrm.cpp12
-rw-r--r--src/mpc-hc/Mpeg2SectionData.cpp2
-rw-r--r--src/mpc-hc/PPageFileMediaInfo.cpp2
-rw-r--r--src/mpc-hc/PlayerCaptureDialog.cpp6
-rw-r--r--src/mpc-hc/PlayerCaptureDialog.h4
-rw-r--r--src/mpc-hc/PlayerSeekBar.cpp2
-rw-r--r--src/mpc-hc/PlayerStatusBar.cpp2
-rw-r--r--src/mpc-hc/QuicktimeGraph.cpp2
-rw-r--r--src/mpc-hc/RealMediaGraph.cpp2
-rw-r--r--src/mpc-hc/RealMediaWindowlessSite.cpp8
-rw-r--r--src/mpc-hc/ShaderAutoCompleteDlg.cpp2
-rw-r--r--src/mpc-hc/VMROSD.cpp4
-rw-r--r--src/mpc-hc/mplayerc.cpp18
86 files changed, 355 insertions, 352 deletions
diff --git a/include/moreuuids.h b/include/moreuuids.h
index 2a57356f7..07531c5f0 100644
--- a/include/moreuuids.h
+++ b/include/moreuuids.h
@@ -377,7 +377,7 @@ struct WAVEFORMATEXPS2 : public WAVEFORMATEX {
DWORD dwInterleave;
struct WAVEFORMATEXPS2() {
- memset(this, 0, sizeof(*this));
+ ZeroMemory(this, sizeof(*this));
cbSize = sizeof(WAVEFORMATEXPS2) - sizeof(WAVEFORMATEX);
}
};
@@ -1112,7 +1112,7 @@ struct WAVEFORMATEX_HDMV_LPCM : public WAVEFORMATEX {
BYTE channel_conf;
struct WAVEFORMATEX_HDMV_LPCM() {
- memset(this, 0, sizeof(*this));
+ ZeroMemory(this, sizeof(*this));
cbSize = sizeof(WAVEFORMATEX_HDMV_LPCM) - sizeof(WAVEFORMATEX);
}
};
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp
index 22a4d2d40..bdbe40eb4 100644
--- a/src/DSUtil/DSUtil.cpp
+++ b/src/DSUtil/DSUtil.cpp
@@ -55,7 +55,7 @@ void DumpStreamConfig(const TCHAR* fn, IAMStreamConfig* pAMVSCCap)
AM_MEDIA_TYPE* pmt = nullptr;
VIDEO_STREAM_CONFIG_CAPS caps;
- memset(&caps, 0, sizeof(caps));
+ ZeroMemory(&caps, sizeof(caps));
s.Format(_T("%d\n"), i);
f.WriteString(s);
@@ -891,7 +891,7 @@ bool GetKeyFrames(CString fn, CUIntArray& kfs)
PAVIFILE pfile;
if (AVIFileOpen(&pfile, fn, OF_SHARE_DENY_WRITE, 0L) == 0) {
AVIFILEINFO afi;
- memset(&afi, 0, sizeof(afi));
+ ZeroMemory(&afi, sizeof(afi));
AVIFileInfo(pfile, &afi, sizeof(AVIFILEINFO));
CComPtr<IAVIStream> pavi;
@@ -1015,7 +1015,7 @@ void memsetw(void* dst, unsigned short c, size_t nbytes)
bool ExtractBIH(const AM_MEDIA_TYPE* pmt, BITMAPINFOHEADER* bih)
{
if (pmt && bih) {
- memset(bih, 0, sizeof(*bih));
+ ZeroMemory(bih, sizeof(*bih));
if (pmt->formattype == FORMAT_VideoInfo) {
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)pmt->pbFormat;
@@ -1157,7 +1157,7 @@ bool MakeMPEG2MediaType(CMediaType& mt, BYTE* seqhdr, DWORD len, int w, int h)
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader));
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
vih->hdr.bmiHeader.biWidth = w;
vih->hdr.bmiHeader.biHeight = h;
@@ -1188,7 +1188,7 @@ bool MakeMPEG2MediaType(CMediaType& mt, BYTE* seqhdr, DWORD len, int w, int h)
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + len);
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
vih->hdr.bmiHeader.biWidth = w;
vih->hdr.bmiHeader.biHeight = h;
@@ -2642,8 +2642,8 @@ void TracePinInfo(IPin* pPin)
PIN_INFO ConnectedInfo;
CComPtr<IPin> pConnected;
- memset(&ConnectedInfo, 0, sizeof(ConnectedInfo));
- memset(&ConnectedFilterInfo, 0, sizeof(ConnectedFilterInfo));
+ ZeroMemory(&ConnectedInfo, sizeof(ConnectedInfo));
+ ZeroMemory(&ConnectedFilterInfo, sizeof(ConnectedFilterInfo));
if (SUCCEEDED(pPin->ConnectedTo(&pConnected))) {
pConnected->QueryPinInfo(&ConnectedInfo);
ConnectedInfo.pFilter->QueryFilterInfo(&ConnectedFilterInfo);
diff --git a/src/DSUtil/HdmvClipInfo.h b/src/DSUtil/HdmvClipInfo.h
index af9cf4b0a..261c7c4b7 100644
--- a/src/DSUtil/HdmvClipInfo.h
+++ b/src/DSUtil/HdmvClipInfo.h
@@ -73,7 +73,7 @@ public:
struct Stream {
Stream() {
- memset(this, 0, sizeof(*this));
+ ZeroMemory(this, sizeof(*this));
}
short m_PID;
PES_STREAM_TYPE m_Type;
diff --git a/src/DSUtil/NullRenderers.cpp b/src/DSUtil/NullRenderers.cpp
index cd7a61604..83f2e40bb 100644
--- a/src/DSUtil/NullRenderers.cpp
+++ b/src/DSUtil/NullRenderers.cpp
@@ -72,7 +72,7 @@ public:
STDMETHODIMP GetAllocatorRequirements(ALLOCATOR_PROPERTIES* pProps) {
// 1 buffer required
- memset(pProps, 0, sizeof(ALLOCATOR_PROPERTIES));
+ ZeroMemory(pProps, sizeof(ALLOCATOR_PROPERTIES));
pProps->cbBuffer = 1;
return S_OK;
}
diff --git a/src/DSUtil/WinAPIUtils.cpp b/src/DSUtil/WinAPIUtils.cpp
index 769033788..2125e99da 100644
--- a/src/DSUtil/WinAPIUtils.cpp
+++ b/src/DSUtil/WinAPIUtils.cpp
@@ -206,7 +206,7 @@ int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX* /*lpelfe*/, NEWTEXTMETRICEX* /*lpn
void GetMessageFont(LOGFONT* lf)
{
- SecureZeroMemory(lf, sizeof(LOGFONT));
+ ZeroMemory(lf, sizeof(LOGFONT));
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
if (!SysVersion::IsVistaOrLater()) {
@@ -219,7 +219,7 @@ void GetMessageFont(LOGFONT* lf)
void GetStatusFont(LOGFONT* lf)
{
- SecureZeroMemory(lf, sizeof(LOGFONT));
+ ZeroMemory(lf, sizeof(LOGFONT));
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
if (!SysVersion::IsVistaOrLater()) {
diff --git a/src/DSUtil/text.cpp b/src/DSUtil/text.cpp
index 961b930f1..9403c84ab 100644
--- a/src/DSUtil/text.cpp
+++ b/src/DSUtil/text.cpp
@@ -38,10 +38,10 @@ DWORD CharSetToCodePage(DWORD dwCharSet)
CStringA ConvertMBCS(CStringA str, DWORD SrcCharSet, DWORD DstCharSet)
{
WCHAR* utf16 = DEBUG_NEW WCHAR[str.GetLength() + 1];
- memset(utf16, 0, (str.GetLength() + 1)*sizeof(WCHAR));
+ ZeroMemory(utf16, (str.GetLength() + 1)*sizeof(WCHAR));
CHAR* mbcs = DEBUG_NEW CHAR[str.GetLength() * 6 + 1];
- memset(mbcs, 0, str.GetLength() * 6 + 1);
+ ZeroMemory(mbcs, str.GetLength() * 6 + 1);
int len = MultiByteToWideChar(
CharSetToCodePage(SrcCharSet),
diff --git a/src/DeCSS/DeCSSInputPin.cpp b/src/DeCSS/DeCSSInputPin.cpp
index 29e3ecb43..499a50bed 100644
--- a/src/DeCSS/DeCSSInputPin.cpp
+++ b/src/DeCSS/DeCSSInputPin.cpp
@@ -41,10 +41,10 @@ CDeCSSInputPin::CDeCSSInputPin(TCHAR* pObjectName, CTransformFilter* pFilter, HR
: CTransformInputPin(pObjectName, pFilter, phr, pName)
, m_varient(-1)
{
- memset(m_Challenge, 0, sizeof(m_Challenge));
- memset(m_KeyCheck, 0, sizeof(m_KeyCheck));
- memset(m_DiscKey, 0, sizeof(m_DiscKey));
- memset(m_TitleKey, 0, sizeof(m_TitleKey));
+ ZeroMemory(m_Challenge, sizeof(m_Challenge));
+ ZeroMemory(m_KeyCheck, sizeof(m_KeyCheck));
+ ZeroMemory(m_DiscKey, sizeof(m_DiscKey));
+ ZeroMemory(m_TitleKey, sizeof(m_TitleKey));
}
STDMETHODIMP CDeCSSInputPin::NonDelegatingQueryInterface(REFIID riid, void** ppv)
@@ -70,7 +70,7 @@ STDMETHODIMP CDeCSSInputPin::Receive(IMediaSample* pSample)
if (CComQIPtr<IMediaSample2> pMS2 = pSample) {
AM_SAMPLE2_PROPERTIES props;
- memset(&props, 0, sizeof(props));
+ ZeroMemory(&props, sizeof(props));
if (SUCCEEDED(pMS2->GetProperties(sizeof(props), (BYTE*)&props))
&& (props.dwTypeSpecificFlags & AM_UseNewCSSKey)) {
props.dwTypeSpecificFlags &= ~AM_UseNewCSSKey;
diff --git a/src/DeCSS/udf.cpp b/src/DeCSS/udf.cpp
index 6007219bf..30b241d2a 100644
--- a/src/DeCSS/udf.cpp
+++ b/src/DeCSS/udf.cpp
@@ -218,7 +218,7 @@ tp_udf_file udf_get_sub(const HANDLE hDrive, tp_udf_file f)
return nullptr;
}
- memset(newf, 0, sizeof(*newf));
+ ZeroMemory(newf, sizeof(*newf));
strcpy_s(newf->name, f->name); // maybe just ""?
newf->sec_size = f->sec_size;
newf->partition_lba = f->partition_lba;
diff --git a/src/MPCTestAPI/MPCTestAPIDlg.cpp b/src/MPCTestAPI/MPCTestAPIDlg.cpp
index 74da1ee7b..41d66b77c 100644
--- a/src/MPCTestAPI/MPCTestAPIDlg.cpp
+++ b/src/MPCTestAPI/MPCTestAPIDlg.cpp
@@ -247,7 +247,7 @@ void CRegisterCopyDataDlg::OnButtonFindwindow()
strExec.Format(_T("%s /slave %d"), m_strMPCPath, PtrToInt(GetSafeHwnd()));
UpdateData(TRUE);
- memset(&StartupInfo, 0, sizeof(StartupInfo));
+ ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
GetStartupInfo(&StartupInfo);
if (CreateProcess(nullptr, (LPTSTR)(LPCTSTR)strExec, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &StartupInfo, &ProcessInfo)) {
diff --git a/src/SubPic/DX9SubPic.cpp b/src/SubPic/DX9SubPic.cpp
index bc9652c96..596dcad23 100644
--- a/src/SubPic/DX9SubPic.cpp
+++ b/src/SubPic/DX9SubPic.cpp
@@ -32,11 +32,11 @@ CDX9SubPic::CDX9SubPic(IDirect3DSurface9* pSurface, CDX9SubPicAllocator* pAlloca
, m_pAllocator(pAllocator)
, m_bExternalRenderer(bExternalRenderer)
{
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (SUCCEEDED(m_pSurface->GetDesc(&d3dsd))) {
- m_maxsize.SetSize(d3dsd.Width, d3dsd.Height);
- m_rcDirty.SetRect(0, 0, d3dsd.Width, d3dsd.Height);
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (SUCCEEDED(m_pSurface->GetDesc(&desc))) {
+ m_maxsize.SetSize(desc.Width, desc.Height);
+ m_rcDirty.SetRect(0, 0, desc.Width, desc.Height);
}
}
@@ -74,9 +74,9 @@ STDMETHODIMP_(void*) CDX9SubPic::GetObject()
STDMETHODIMP CDX9SubPic::GetDesc(SubPicDesc& spd)
{
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(m_pSurface->GetDesc(&d3dsd))) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(m_pSurface->GetDesc(&desc))) {
return E_FAIL;
}
@@ -84,8 +84,8 @@ STDMETHODIMP CDX9SubPic::GetDesc(SubPicDesc& spd)
spd.w = m_size.cx;
spd.h = m_size.cy;
spd.bpp =
- d3dsd.Format == D3DFMT_A8R8G8B8 ? 32 :
- d3dsd.Format == D3DFMT_A4R4G4B4 ? 16 : 0;
+ desc.Format == D3DFMT_A8R8G8B8 ? 32 :
+ desc.Format == D3DFMT_A4R4G4B4 ? 16 : 0;
spd.pitch = 0;
spd.bits = nullptr;
spd.vidrect = m_vidrect;
@@ -175,9 +175,9 @@ STDMETHODIMP CDX9SubPic::ClearDirtyRect(DWORD color)
STDMETHODIMP CDX9SubPic::Lock(SubPicDesc& spd)
{
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(m_pSurface->GetDesc(&d3dsd))) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(m_pSurface->GetDesc(&desc))) {
return E_FAIL;
}
@@ -191,8 +191,8 @@ STDMETHODIMP CDX9SubPic::Lock(SubPicDesc& spd)
spd.w = m_size.cx;
spd.h = m_size.cy;
spd.bpp =
- d3dsd.Format == D3DFMT_A8R8G8B8 ? 32 :
- d3dsd.Format == D3DFMT_A4R4G4B4 ? 16 : 0;
+ desc.Format == D3DFMT_A8R8G8B8 ? 32 :
+ desc.Format == D3DFMT_A4R4G4B4 ? 16 : 0;
spd.pitch = LockedRect.Pitch;
spd.bits = (BYTE*)LockedRect.pBits;
spd.vidrect = m_vidrect;
@@ -244,14 +244,14 @@ STDMETHODIMP CDX9SubPic::AlphaBlt(RECT* pSrc, RECT* pDst, SubPicDesc* pTarget)
HRESULT hr;
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(pTexture->GetLevelDesc(0, &d3dsd)) /*|| d3dsd.Type != D3DRTYPE_TEXTURE*/) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(pTexture->GetLevelDesc(0, &desc)) /*|| desc.Type != D3DRTYPE_TEXTURE*/) {
return E_FAIL;
}
- float w = (float)d3dsd.Width;
- float h = (float)d3dsd.Height;
+ float w = (float)desc.Width;
+ float h = (float)desc.Height;
// Be careful with the code that follows. Some compilers (e.g. Visual Studio 2012) used to miscompile
// it in some cases (namely x64 with optimizations /O2 /Ot). This bug led pVertices not to be correctly
diff --git a/src/Subtitles/CCDecoder.cpp b/src/Subtitles/CCDecoder.cpp
index c8e5cc0b9..410e64c72 100644
--- a/src/Subtitles/CCDecoder.cpp
+++ b/src/Subtitles/CCDecoder.cpp
@@ -28,8 +28,8 @@ CCDecoder::CCDecoder(CString fn, CString rawfn) : m_fn(fn), m_rawfn(rawfn)
m_time = 0;
m_fEndOfCaption = false;
- memset(m_buff, 0, sizeof(m_buff));
- memset(m_disp, 0, sizeof(m_disp));
+ ZeroMemory(m_buff, sizeof(m_buff));
+ ZeroMemory(m_disp, sizeof(m_disp));
m_cursor = CPoint(0, 0);
if (!m_rawfn.IsEmpty()) {
@@ -256,9 +256,9 @@ void CCDecoder::DecodeCC(const BYTE* buff, int len, __int64 time)
PutChar(charmap[c - 0x20]);
} else if (buff[i] == 0x94 && buff[i + 1] == 0xae) { // Erase Non-displayed [buffer] Memory
- memset(m_buff, 0, sizeof(m_buff));
+ ZeroMemory(m_buff, sizeof(m_buff));
} else if (buff[i] == 0x94 && buff[i + 1] == 0x20) { // Resume Caption Loading
- memset(m_buff, 0, sizeof(m_buff));
+ ZeroMemory(m_buff, sizeof(m_buff));
} else if (buff[i] == 0x94 && buff[i + 1] == 0x2f) { // End Of Caption
if (memcmp(m_disp, m_buff, sizeof(m_disp)) != 0) {
if (m_fEndOfCaption) {
@@ -275,7 +275,7 @@ void CCDecoder::DecodeCC(const BYTE* buff, int len, __int64 time)
SaveDisp(time + (i / 2) * 1000 / 30);
}
- memset(m_disp, 0, sizeof(m_disp));
+ ZeroMemory(m_disp, sizeof(m_disp));
} else if (buff[i] == 0x97 && (buff[i + 1] == 0xa1 || buff[i + 1] == 0xa2 || buff[i + 1] == 0x23)) { // Tab Over
OffsetCursor(buff[i + 1] & 3, 0);
} else if (buff[i] == 0x91 || buff[i] == 0x92 || buff[i] == 0x15 || buff[i] == 0x16
diff --git a/src/Subtitles/DVBSub.h b/src/Subtitles/DVBSub.h
index 0f0e0d2db..4462d4bf6 100644
--- a/src/Subtitles/DVBSub.h
+++ b/src/Subtitles/DVBSub.h
@@ -79,7 +79,7 @@ public:
id = 0;
version_number = 0;
size = 0;
- memset(palette, 0, sizeof(palette));
+ ZeroMemory(palette, sizeof(palette));
}
};
diff --git a/src/Subtitles/HdmvSub.h b/src/Subtitles/HdmvSub.h
index b47bc5e8a..5501b2b65 100644
--- a/src/Subtitles/HdmvSub.h
+++ b/src/Subtitles/HdmvSub.h
@@ -61,14 +61,16 @@ public:
};
struct HDMV_CLUT {
- BYTE id;
- BYTE version_number;
- BYTE size;
+ BYTE id;
+ BYTE version_number;
+ BYTE size;
HDMV_PALETTE palette[256];
- HDMV_CLUT() : id(0), version_number(0), size(0) {
- memset(palette, 0, sizeof(palette));
+ HDMV_CLUT() : id(0)
+ , version_number(0)
+ , size(0) {
+ ZeroMemory(palette, sizeof(palette));
}
};
diff --git a/src/Subtitles/RTS.cpp b/src/Subtitles/RTS.cpp
index e23f37a26..5c5c14029 100644
--- a/src/Subtitles/RTS.cpp
+++ b/src/Subtitles/RTS.cpp
@@ -42,7 +42,7 @@ static long revcolor(long c)
CMyFont::CMyFont(STSStyle& style)
{
LOGFONT lf;
- memset(&lf, 0, sizeof(lf));
+ ZeroMemory(&lf, sizeof(lf));
lf <<= style;
lf.lfHeight = (LONG)(style.fontSize + 0.5);
lf.lfOutPrecision = OUT_TT_PRECIS;
@@ -747,7 +747,7 @@ CClipper::CClipper(CStringW str, CSize size, double scalex, double scaley, bool
m_inverse = inverse;
m_cpOffset = cpOffset;
- memset(m_pAlphaMask, 0, size.cx * size.cy);
+ ZeroMemory(m_pAlphaMask, size.cx * size.cy);
Paint(CPoint(0, 0), CPoint(0, 0));
@@ -1049,7 +1049,7 @@ CRect CLine::PaintBody(SubPicDesc& spd, CRect& clipRect, BYTE* pAlphaMask, CPoin
CSubtitle::CSubtitle()
{
- memset(m_effects, 0, sizeof(Effect*)*EF_NUMBEROFEFFECTS);
+ ZeroMemory(m_effects, sizeof(Effect*)*EF_NUMBEROFEFFECTS);
m_pClipper = nullptr;
m_clipInverse = false;
m_scalex = m_scaley = 1;
@@ -1084,7 +1084,7 @@ void CSubtitle::EmptyEffects()
delete m_effects[i];
}
}
- memset(m_effects, 0, sizeof(Effect*)*EF_NUMBEROFEFFECTS);
+ ZeroMemory(m_effects, sizeof(Effect*)*EF_NUMBEROFEFFECTS);
}
int CSubtitle::GetFullWidth()
@@ -1304,7 +1304,7 @@ void CSubtitle::CreateClippers(CSize size)
if (k < h) {
BYTE* am = &m_pClipper->m_pAlphaMask[k * w];
- memset(m_pClipper->m_pAlphaMask, 0, am - m_pClipper->m_pAlphaMask);
+ ZeroMemory(m_pClipper->m_pAlphaMask, am - m_pClipper->m_pAlphaMask);
for (ptrdiff_t j = k; j < l; j++, a += da) {
for (ptrdiff_t i = 0; i < w; i++, am++) {
@@ -1335,7 +1335,7 @@ void CSubtitle::CreateClippers(CSize size)
}
}
- memset(am, 0, (h - j)*w);
+ ZeroMemory(am, (h - j)*w);
}
}
}
diff --git a/src/Subtitles/Rasterizer.cpp b/src/Subtitles/Rasterizer.cpp
index 64b0cab2c..f75543ea8 100644
--- a/src/Subtitles/Rasterizer.cpp
+++ b/src/Subtitles/Rasterizer.cpp
@@ -470,7 +470,7 @@ bool Rasterizer::ScanConvert()
TRACE(_T("Error in Rasterizer::ScanConvert: mpScanBuffer is NULL"));
return false;
}
- memset(mpScanBuffer, 0, mHeight * sizeof(unsigned int));
+ ZeroMemory(mpScanBuffer, mHeight * sizeof(unsigned int));
// Scan convert the outline. Yuck, Bezier curves....
@@ -797,7 +797,7 @@ bool Rasterizer::Rasterize(int xsub, int ysub, int fBlur, double fGaussianBlur)
return false;
}
- memset(mpOverlayBuffer, 0, 2 * mOverlayWidth * mOverlayHeight);
+ ZeroMemory(mpOverlayBuffer, 2 * mOverlayWidth * mOverlayHeight);
// Are we doing a border?
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp
index 5af65aa26..606c618e1 100644
--- a/src/Subtitles/STS.cpp
+++ b/src/Subtitles/STS.cpp
@@ -753,7 +753,7 @@ static CStringW MicroDVD2SSA(CStringW str, bool fUnicode, int CharSet)
bool fRestore[8];
int fRestoreLen = 8;
- memset(fRestore, 0, sizeof(bool)*fRestoreLen);
+ ZeroMemory(fRestore, sizeof(bool)*fRestoreLen);
for (int pos = 0, eol; pos < str.GetLength(); pos++) {
if ((eol = FindChar(str, '|', pos, fUnicode, CharSet)) < 0) {
@@ -887,7 +887,7 @@ static CStringW MicroDVD2SSA(CStringW str, bool fUnicode, int CharSet)
}
}
- memset(fRestore, 0, sizeof(bool)*fRestoreLen);
+ ZeroMemory(fRestore, sizeof(bool)*fRestoreLen);
ret += L"\\N";
}
diff --git a/src/Subtitles/VobSubFile.cpp b/src/Subtitles/VobSubFile.cpp
index fd344fda5..8f4e50753 100644
--- a/src/Subtitles/VobSubFile.cpp
+++ b/src/Subtitles/VobSubFile.cpp
@@ -794,7 +794,7 @@ bool CVobSubFile::ReadRar(CString fn)
#endif /* USE_STATIC_UNRAR */
RAROpenArchiveDataEx OpenArchiveData;
- memset(&OpenArchiveData, 0, sizeof(OpenArchiveData));
+ ZeroMemory(&OpenArchiveData, sizeof(OpenArchiveData));
OpenArchiveData.ArcNameW = (LPTSTR)(LPCTSTR)fn;
char fnA[MAX_PATH];
@@ -1545,8 +1545,8 @@ void CVobSubSettings::InitSettings()
m_fOnlyShowForcedSubs = false;
m_fCustomPal = false;
m_tridx = 0;
- memset(m_orgpal, 0, sizeof(m_orgpal));
- memset(m_cuspal, 0, sizeof(m_cuspal));
+ ZeroMemory(m_orgpal, sizeof(m_orgpal));
+ ZeroMemory(m_cuspal, sizeof(m_cuspal));
}
bool CVobSubSettings::GetCustomPal(RGBQUAD* cuspal, int& tridx)
diff --git a/src/Subtitles/VobSubFileRipper.cpp b/src/Subtitles/VobSubFileRipper.cpp
index 8839abc1b..77786b6e2 100644
--- a/src/Subtitles/VobSubFileRipper.cpp
+++ b/src/Subtitles/VobSubFileRipper.cpp
@@ -134,7 +134,7 @@ bool CVobSubFileRipper::LoadIfo(CString fn)
f.Seek(0x254, CFile::begin);
WORD ids[32];
- memset(ids, 0, sizeof(ids));
+ ZeroMemory(ids, sizeof(ids));
int len = 0;
ReadBEw(len);
@@ -1140,7 +1140,7 @@ STDMETHODIMP CVobSubFileRipper::Abort(bool fSavePartial)
void VSFRipperData::Reset()
{
vidsize.SetSize(0, 0);
- memset(&vidinfo, 0, sizeof(vidinfo));
+ ZeroMemory(&vidinfo, sizeof(vidinfo));
pgcs.RemoveAll();
iSelPGC = -1;
fResetTime = fClosedCaption = true;
diff --git a/src/Subtitles/VobSubImage.cpp b/src/Subtitles/VobSubImage.cpp
index 28688509a..22b77dc7d 100644
--- a/src/Subtitles/VobSubImage.cpp
+++ b/src/Subtitles/VobSubImage.cpp
@@ -330,7 +330,7 @@ void CVobSubImage::TrimSubImage()
DWORD* src = (DWORD*)&lpTemp1[offset];
DWORD* dst = (DWORD*)&lpTemp2[1 + w + 1];
- memset(lpTemp2, 0, (1 + w + 1)*sizeof(RGBQUAD));
+ ZeroMemory(lpTemp2, (1 + w + 1)*sizeof(RGBQUAD));
for (int height = h; height; height--, src += rect.Width()) {
*dst++ = 0;
@@ -339,7 +339,7 @@ void CVobSubImage::TrimSubImage()
*dst++ = 0;
}
- memset(dst, 0, (1 + w + 1)*sizeof(RGBQUAD));
+ ZeroMemory(dst, (1 + w + 1)*sizeof(RGBQUAD));
lpPixels = lpTemp2;
diff --git a/src/filters/InternalPropertyPage.cpp b/src/filters/InternalPropertyPage.cpp
index 648b9e751..15c86e5d9 100644
--- a/src/filters/InternalPropertyPage.cpp
+++ b/src/filters/InternalPropertyPage.cpp
@@ -50,7 +50,7 @@ BOOL CInternalPropertyPageWnd::Create(IPropertyPageSite* pPageSite, LPCRECT pRec
}
LOGFONT lf;
- memset(&lf, 0, sizeof(lf));
+ ZeroMemory(&lf, sizeof(lf));
_tcscpy_s(lf.lfFaceName, face);
HDC hDC = ::GetDC(0);
lf.lfHeight = -MulDiv(height, GetDeviceCaps(hDC, LOGPIXELSY), 72);
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp
index 9d8ed5bf2..08ad71913 100644
--- a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp
+++ b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp
@@ -165,7 +165,7 @@ HRESULT CBaseMuxerInputPin::CompleteConnect(IPin* pReceivePin)
if (SUCCEEDED(pPB->CountProperties(&cProperties)) && cProperties > 0) {
for (ULONG iProperty = 0; iProperty < cProperties; iProperty++) {
PROPBAG2 PropBag;
- memset(&PropBag, 0, sizeof(PropBag));
+ ZeroMemory(&PropBag, sizeof(PropBag));
ULONG cPropertiesReturned = 0;
if (FAILED(pPB->GetPropertyInfo(iProperty, 1, &PropBag, &cPropertiesReturned))) {
continue;
diff --git a/src/filters/parser/AviSplitter/AviFile.cpp b/src/filters/parser/AviSplitter/AviFile.cpp
index d30e7ba2e..896b36d1b 100644
--- a/src/filters/parser/AviSplitter/AviFile.cpp
+++ b/src/filters/parser/AviSplitter/AviFile.cpp
@@ -88,7 +88,7 @@ HRESULT CAviFile::BuildAMVIndex()
DWORD ulType;
DWORD ulSize;
- memset(&NewChunk, 0, sizeof(strm_t::chunk));
+ ZeroMemory(&NewChunk, sizeof(strm_t::chunk));
while ((Read(ulType) == S_OK) && (Read(ulSize) == S_OK)) {
switch (ulType) {
case FCC('00dc'): // 01bw: JPeg
@@ -490,8 +490,8 @@ bool CAviFile::IsInterleaved(bool fKeepInfo)
DWORD* curchunks = DEBUG_NEW DWORD[m_avih.dwStreams];
UINT64* cursizes = DEBUG_NEW UINT64[m_avih.dwStreams];
- memset(curchunks, 0, sizeof(DWORD)*m_avih.dwStreams);
- memset(cursizes, 0, sizeof(UINT64)*m_avih.dwStreams);
+ ZeroMemory(curchunks, sizeof(DWORD)*m_avih.dwStreams);
+ ZeroMemory(cursizes, sizeof(UINT64)*m_avih.dwStreams);
int end = 0;
@@ -530,7 +530,7 @@ bool CAviFile::IsInterleaved(bool fKeepInfo)
++curchunk;
}
- memset(curchunks, 0, sizeof(DWORD)*m_avih.dwStreams);
+ ZeroMemory(curchunks, sizeof(DWORD)*m_avih.dwStreams);
strm_t::chunk2 cs2last = {(DWORD) - 1, 0};
diff --git a/src/filters/parser/AviSplitter/AviFile.h b/src/filters/parser/AviSplitter/AviFile.h
index 33f31e8c5..14fba760e 100644
--- a/src/filters/parser/AviSplitter/AviFile.h
+++ b/src/filters/parser/AviSplitter/AviFile.h
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -36,7 +36,7 @@ public:
//using CBaseSplitterFile::Read;
template<typename T>
HRESULT Read(T& var, int offset = 0) {
- memset(&var, 0, sizeof(var));
+ ZeroMemory(&var, sizeof(var));
HRESULT hr = ByteRead((BYTE*)&var + offset, sizeof(var) - offset);
return hr;
}
diff --git a/src/filters/parser/AviSplitter/AviSplitter.cpp b/src/filters/parser/AviSplitter/AviSplitter.cpp
index e9ce4fa4c..37737ed68 100644
--- a/src/filters/parser/AviSplitter/AviSplitter.cpp
+++ b/src/filters/parser/AviSplitter/AviSplitter.cpp
@@ -244,7 +244,7 @@ HRESULT CAviSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
}
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + (ULONG)s->strf.GetCount() - sizeof(BITMAPINFOHEADER));
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(&pvih->bmiHeader, s->strf.GetData(), s->strf.GetCount());
if (s->strh.dwRate > 0) {
pvih->AvgTimePerFrame = 10000000ui64 * s->strh.dwScale / s->strh.dwRate;
@@ -410,7 +410,7 @@ bool CAviSplitterFilter::DemuxInit()
CAutoVectorPtr<UINT64> pSize;
pSize.Allocate(m_pFile->m_avih.dwStreams);
- memset((UINT64*)pSize, 0, sizeof(UINT64)*m_pFile->m_avih.dwStreams);
+ ZeroMemory((UINT64*)pSize, sizeof(UINT64)*m_pFile->m_avih.dwStreams);
m_pFile->Seek(0);
ReIndex(m_pFile->GetLength(), pSize);
@@ -498,7 +498,7 @@ HRESULT CAviSplitterFilter::ReIndex(__int64 end, UINT64* pSize)
void CAviSplitterFilter::DemuxSeek(REFERENCE_TIME rt)
{
- memset((DWORD*)m_tFrame, 0, m_pFile->m_avih.dwStreams * sizeof(DWORD));
+ ZeroMemory((DWORD*)m_tFrame, m_pFile->m_avih.dwStreams * sizeof(DWORD));
m_pFile->Seek(0);
DbgLog((LOG_TRACE, 0, _T("Seek: %I64d"), rt / 10000));
@@ -523,7 +523,7 @@ bool CAviSplitterFilter::DemuxLoop()
CAtlArray<BOOL> fDiscontinuity;
fDiscontinuity.SetCount(m_pFile->m_avih.dwStreams);
- memset(fDiscontinuity.GetData(), 0, m_pFile->m_avih.dwStreams * sizeof(BOOL));
+ ZeroMemory(fDiscontinuity.GetData(), m_pFile->m_avih.dwStreams * sizeof(BOOL));
while (SUCCEEDED(hr) && !CheckRequest(nullptr)) {
DWORD curTrack = DWORD_MAX;
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
index eac63a4b1..fed2bfccf 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
@@ -199,7 +199,7 @@ CBaseSplitterOutputPin::CBaseSplitterOutputPin(CAtlArray<CMediaType>& mts, LPCWS
{
m_mts.Copy(mts);
m_nBuffers = max(nBuffers, 1);
- memset(&m_brs, 0, sizeof(m_brs));
+ ZeroMemory(&m_brs, sizeof(m_brs));
m_brs.rtLastDeliverTime = Packet::INVALID_TIME;
}
@@ -211,7 +211,7 @@ CBaseSplitterOutputPin::CBaseSplitterOutputPin(LPCWSTR pName, CBaseFilter* pFilt
, m_QueueMaxPackets(QueueMaxPackets)
{
m_nBuffers = max(nBuffers, 1);
- memset(&m_brs, 0, sizeof(m_brs));
+ ZeroMemory(&m_brs, sizeof(m_brs));
m_brs.rtLastDeliverTime = Packet::INVALID_TIME;
}
diff --git a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
index 784e2614c..5737a58fb 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
@@ -69,7 +69,7 @@ bool CBaseSplitterFileEx::NextMpegStartCode(BYTE& code, __int64 len)
bool CBaseSplitterFileEx::Read(pshdr& h)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
BYTE b = (BYTE)BitRead(8, true);
@@ -121,7 +121,7 @@ bool CBaseSplitterFileEx::Read(pshdr& h)
bool CBaseSplitterFileEx::Read(pssyshdr& h)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
WORD len = (WORD)BitRead(16);
MARKER;
@@ -150,7 +150,7 @@ bool CBaseSplitterFileEx::Read(pssyshdr& h)
bool CBaseSplitterFileEx::Read(peshdr& h, BYTE code)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (!(code >= 0xbd && code < 0xf0 || code == 0xfd)) { // 0xfd => blu-ray (.m2ts)
return false;
@@ -410,7 +410,7 @@ bool CBaseSplitterFileEx::Read(seqhdr& h, int len, CMediaType* pmt)
pmt->formattype = FORMAT_MPEGVideo;
int len = FIELD_OFFSET(MPEG1VIDEOINFO, bSequenceHeader) + int(shlen + shextlen);
MPEG1VIDEOINFO* vi = (MPEG1VIDEOINFO*)DEBUG_NEW BYTE[len];
- memset(vi, 0, len);
+ ZeroMemory(vi, len);
vi->hdr.dwBitRate = h.bitrate;
vi->hdr.AvgTimePerFrame = h.ifps;
vi->hdr.bmiHeader.biSize = sizeof(vi->hdr.bmiHeader);
@@ -432,7 +432,7 @@ bool CBaseSplitterFileEx::Read(seqhdr& h, int len, CMediaType* pmt)
pmt->formattype = FORMAT_MPEG2_VIDEO;
int len = FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + int(shlen + shextlen);
MPEG2VIDEOINFO* vi = (MPEG2VIDEOINFO*)DEBUG_NEW BYTE[len];
- memset(vi, 0, len);
+ ZeroMemory(vi, len);
vi->hdr.dwBitRate = h.bitrate;
vi->hdr.AvgTimePerFrame = h.ifps;
vi->hdr.dwPictAspectRatioX = h.arx;
@@ -460,7 +460,7 @@ bool CBaseSplitterFileEx::Read(seqhdr& h, int len, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(mpahdr& h, int len, bool fAllowV25, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
int syncbits = fAllowV25 ? 11 : 12;
@@ -557,7 +557,7 @@ bool CBaseSplitterFileEx::Read(mpahdr& h, int len, bool fAllowV25, CMediaType* p
? sizeof(WAVEFORMATEX/*MPEGLAYER3WAVEFORMAT*/) // no need to overcomplicate this...
: sizeof(MPEG1WAVEFORMAT);
WAVEFORMATEX* wfe = (WAVEFORMATEX*)DEBUG_NEW BYTE[size];
- memset(wfe, 0, size);
+ ZeroMemory(wfe, size);
wfe->cbSize = WORD(size - sizeof(WAVEFORMATEX));
if (h.layer == 3) {
@@ -610,7 +610,7 @@ bool CBaseSplitterFileEx::Read(mpahdr& h, int len, bool fAllowV25, CMediaType* p
bool CBaseSplitterFileEx::Read(latm_aachdr& h, int len, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
for (; len >= 7 && BitRead(11, true) != AAC_LATM_SYNC_WORD; len--) {
BitRead(8);
@@ -632,7 +632,7 @@ bool CBaseSplitterFileEx::Read(latm_aachdr& h, int len, CMediaType* pmt)
}
WAVEFORMATEX* wfe = (WAVEFORMATEX*)DEBUG_NEW BYTE[sizeof(WAVEFORMATEX)];
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->wFormatTag = WAVE_FORMAT_LATM_AAC;
wfe->nChannels = h.channels;
wfe->nSamplesPerSec = h.samplerate;
@@ -652,7 +652,7 @@ bool CBaseSplitterFileEx::Read(latm_aachdr& h, int len, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(aachdr& h, int len, CMediaType* pmt, MPEG_TYPES m_type)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
__int64 pos = 0;
int found_fake_sync = m_type == mpeg_ts ? 0 : 1;
@@ -709,7 +709,7 @@ bool CBaseSplitterFileEx::Read(aachdr& h, int len, CMediaType* pmt, MPEG_TYPES m
}
WAVEFORMATEX* wfe = (WAVEFORMATEX*)DEBUG_NEW BYTE[sizeof(WAVEFORMATEX) + 5];
- memset(wfe, 0, sizeof(WAVEFORMATEX) + 5);
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX) + 5);
wfe->wFormatTag = WAVE_FORMAT_AAC;
wfe->nChannels = h.channels <= 6 ? h.channels : 2;
wfe->nSamplesPerSec = freq[h.freq];
@@ -736,7 +736,7 @@ bool CBaseSplitterFileEx::Read(ac3hdr& h, int len, CMediaType* pmt, bool find_sy
__int64 startpos = GetPos();
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
// Parse TrueHD and MLP header
if (!AC3CoreOnly) {
@@ -860,7 +860,7 @@ bool CBaseSplitterFileEx::Read(ac3hdr& h, int len, CMediaType* pmt, bool find_sy
}
WAVEFORMATEX wfe;
- memset(&wfe, 0, sizeof(wfe));
+ ZeroMemory(&wfe, sizeof(wfe));
wfe.wFormatTag = WAVE_FORMAT_DOLBY_AC3;
static int channels[] = {2, 1, 2, 3, 3, 4, 4, 5};
@@ -891,7 +891,7 @@ bool CBaseSplitterFileEx::Read(ac3hdr& h, int len, CMediaType* pmt, bool find_sy
bool CBaseSplitterFileEx::Read(dtshdr& h, int len, CMediaType* pmt, bool find_sync)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (find_sync) {
for (; len >= 10 && BitRead(32, true) != 0x7ffe8001; len--) {
@@ -934,7 +934,7 @@ bool CBaseSplitterFileEx::Read(dtshdr& h, int len, CMediaType* pmt, bool find_sy
}
WAVEFORMATEX wfe;
- memset(&wfe, 0, sizeof(wfe));
+ ZeroMemory(&wfe, sizeof(wfe));
wfe.wFormatTag = WAVE_FORMAT_DVD_DTS;
static int channels[] = {1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8};
@@ -976,7 +976,7 @@ bool CBaseSplitterFileEx::Read(dtshdr& h, int len, CMediaType* pmt, bool find_sy
bool CBaseSplitterFileEx::Read(lpcmhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
h.emphasis = BitRead(1);
h.mute = BitRead(1);
@@ -997,7 +997,7 @@ bool CBaseSplitterFileEx::Read(lpcmhdr& h, CMediaType* pmt)
}
WAVEFORMATEX wfe;
- memset(&wfe, 0, sizeof(wfe));
+ ZeroMemory(&wfe, sizeof(wfe));
wfe.wFormatTag = WAVE_FORMAT_PCM;
wfe.nChannels = h.channels + 1;
static int freq[] = {48000, 96000, 44100, 32000};
@@ -1026,7 +1026,7 @@ bool CBaseSplitterFileEx::Read(lpcmhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(dvdalpcmhdr& h, int len, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (len < 8) {
return false;
}
@@ -1059,7 +1059,7 @@ bool CBaseSplitterFileEx::Read(dvdalpcmhdr& h, int len, CMediaType* pmt)
}
WAVEFORMATEX wfe;
- memset(&wfe, 0, sizeof(wfe));
+ ZeroMemory(&wfe, sizeof(wfe));
wfe.wFormatTag = WAVE_FORMAT_UNKNOWN;
static const WORD depth[] = {16, 20, 24};
static const DWORD freq[] = {48000, 96000, 192000, 0, 0, 0, 0, 0, 44100, 88200, 1764000};
@@ -1088,7 +1088,7 @@ bool CBaseSplitterFileEx::Read(dvdalpcmhdr& h, int len, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(hdmvlpcmhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
h.size = (WORD)BitRead(16);
h.channels = (BYTE)BitRead(4);
@@ -1131,7 +1131,7 @@ bool CBaseSplitterFileEx::Read(hdmvlpcmhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(mlphdr& h, int len, CMediaType* pmt, bool find_sync)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (len < 20) {
return false;
}
@@ -1188,7 +1188,7 @@ bool CBaseSplitterFileEx::Read(mlphdr& h, int len, CMediaType* pmt, bool find_sy
bool CBaseSplitterFileEx::Read(dvdspuhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (!pmt) {
return true;
@@ -1203,7 +1203,7 @@ bool CBaseSplitterFileEx::Read(dvdspuhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(hdmvsubhdr& h, CMediaType* pmt, const char* language_code)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (!pmt) {
return true;
@@ -1215,7 +1215,7 @@ bool CBaseSplitterFileEx::Read(hdmvsubhdr& h, CMediaType* pmt, const char* langu
SUBTITLEINFO* psi = (SUBTITLEINFO*)pmt->AllocFormatBuffer(sizeof(SUBTITLEINFO));
if (psi) {
- memset(psi, 0, pmt->FormatLength());
+ ZeroMemory(psi, pmt->FormatLength());
strcpy_s(psi->IsoLang, language_code ? language_code : "eng");
}
@@ -1224,7 +1224,7 @@ bool CBaseSplitterFileEx::Read(hdmvsubhdr& h, CMediaType* pmt, const char* langu
bool CBaseSplitterFileEx::Read(svcdspuhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (!pmt) {
return true;
@@ -1239,7 +1239,7 @@ bool CBaseSplitterFileEx::Read(svcdspuhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(cvdspuhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (!pmt) {
return true;
@@ -1254,7 +1254,7 @@ bool CBaseSplitterFileEx::Read(cvdspuhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(ps2audhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (BitRead(16, true) != 'SS') {
return false;
@@ -1307,7 +1307,7 @@ bool CBaseSplitterFileEx::Read(ps2audhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(ps2subhdr& h, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if (!pmt) {
return true;
@@ -1322,7 +1322,7 @@ bool CBaseSplitterFileEx::Read(ps2subhdr& h, CMediaType* pmt)
bool CBaseSplitterFileEx::Read(tshdr& h, bool fSync)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
BitByteAlign();
@@ -1448,7 +1448,7 @@ bool CBaseSplitterFileEx::Read(tshdr& h, bool fSync)
bool CBaseSplitterFileEx::Read(trsechdr& h)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
BYTE pointer_field = (BYTE)BitRead(8);
while (pointer_field-- > 0) {
@@ -1471,7 +1471,7 @@ bool CBaseSplitterFileEx::Read(trsechdr& h)
bool CBaseSplitterFileEx::Read(pvahdr& h, bool fSync)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
BitByteAlign();
@@ -1705,7 +1705,7 @@ bool CBaseSplitterFileEx::Read(avchdr& h, int len, CMediaType* pmt)
pmt->formattype = FORMAT_MPEG2_VIDEO;
int len = FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + extra;
MPEG2VIDEOINFO* vi = (MPEG2VIDEOINFO*)DEBUG_NEW BYTE[len];
- memset(vi, 0, len);
+ ZeroMemory(vi, len);
// vi->hdr.dwBitRate = ;
vi->hdr.AvgTimePerFrame = h.AvgTimePerFrame;
if (!h.sar.num) {
@@ -2067,7 +2067,7 @@ bool CBaseSplitterFileEx::Read(avchdr& h, spsppsindex index)
bool CBaseSplitterFileEx::Read(vc1hdr& h, int len, CMediaType* pmt, int guid_flag)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
__int64 endpos = GetPos() + len; // - sequence header length
__int64 extrapos = 0, extralen = 0;
@@ -2173,7 +2173,7 @@ bool CBaseSplitterFileEx::Read(vc1hdr& h, int len, CMediaType* pmt, int guid_fla
pmt->formattype = FORMAT_VIDEOINFO2;
int vi_len = sizeof(VIDEOINFOHEADER2) + (int)extralen + 1;
VIDEOINFOHEADER2* vi = (VIDEOINFOHEADER2*)DEBUG_NEW BYTE[vi_len];
- memset(vi, 0, vi_len);
+ ZeroMemory(vi, vi_len);
vi->AvgTimePerFrame = (10000000I64 * nFrameRateNum) / nFrameRateDen;
if (!h.sar.num) {
@@ -2210,7 +2210,7 @@ bool CBaseSplitterFileEx::Read(vc1hdr& h, int len, CMediaType* pmt, int guid_fla
bool CBaseSplitterFileEx::Read(dvbsub& h, int len, CMediaType* pmt)
{
- memset(&h, 0, sizeof(h));
+ ZeroMemory(&h, sizeof(h));
if ((BitRead(32, true) & 0xFFFFFF00) == 0x20000f00) {
static const SUBTITLEINFO SubFormat = { 0, "", L"" };
diff --git a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.h b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.h
index b91fe555e..3b4753ebb 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.h
+++ b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.h
@@ -97,7 +97,7 @@ public:
BYTE id_ext;
struct peshdr() {
- memset(this, 0, sizeof(*this));
+ ZeroMemory(this, sizeof(*this));
}
};
@@ -380,7 +380,7 @@ public:
, crop_right(0)
, crop_top(0)
, crop_bottom(0) {
- memset(spspps, 0, sizeof(spspps));
+ ZeroMemory(spspps, sizeof(spspps));
lastid = 0;
views = 1;
AvgTimePerFrame = 0;
diff --git a/src/filters/parser/FLVSplitter/FLVSplitter.cpp b/src/filters/parser/FLVSplitter/FLVSplitter.cpp
index 71dc63c2b..1b16e6c0c 100644
--- a/src/filters/parser/FLVSplitter/FLVSplitter.cpp
+++ b/src/filters/parser/FLVSplitter/FLVSplitter.cpp
@@ -308,7 +308,7 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.majortype = MEDIATYPE_Audio;
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->nSamplesPerSec = 44100 * (1 << at.SoundRate) / 8;
wfe->wBitsPerSample = 8 * (at.SoundSize + 1);
wfe->nChannels = at.SoundType + 1;
@@ -382,7 +382,7 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
};
wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX) + configSize);
- memset(wfe, 0, mt.FormatLength());
+ ZeroMemory(wfe, mt.FormatLength());
wfe->nSamplesPerSec = sampleRates[iSampleRate];
wfe->wBitsPerSample = 16;
wfe->nChannels = channels[iChannels];
@@ -406,7 +406,7 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.majortype = MEDIATYPE_Video;
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(vih, 0, sizeof(VIDEOINFOHEADER));
+ ZeroMemory(vih, sizeof(VIDEOINFOHEADER));
BITMAPINFOHEADER* bih = &vih->bmiHeader;
@@ -500,7 +500,7 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
if (arx && arx != w || ary && ary != h) {
VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER2));
- memset(vih2, 0, sizeof(VIDEOINFOHEADER2));
+ ZeroMemory(vih2, sizeof(VIDEOINFOHEADER2));
vih2->dwPictAspectRatioX = arx;
vih2->dwPictAspectRatioY = ary;
bih = &vih2->bmiHeader;
@@ -537,7 +537,7 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + headerSize);
- memset(vih, 0, mt.FormatLength());
+ ZeroMemory(vih, mt.FormatLength());
vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
vih->hdr.bmiHeader.biPlanes = 1;
vih->hdr.bmiHeader.biBitCount = 24;
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
index 5d896373e..dd1d7bb8f 100644
--- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp
+++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
@@ -569,7 +569,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.majortype = MEDIATYPE_Video;
mt.formattype = FORMAT_VideoInfo;
vih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + di->GetDataSize());
- memset(vih, 0, mt.FormatLength());
+ ZeroMemory(vih, mt.FormatLength());
vih->dwBitRate = video_desc->GetAvgBitrate() / 8;
vih->bmiHeader.biSize = sizeof(vih->bmiHeader);
vih->bmiHeader.biWidth = biWidth;
@@ -582,7 +582,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.formattype = FORMAT_MPEG2Video;
{
MPEG2VIDEOINFO* mvih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + di->GetDataSize());
- memset(mvih, 0, mt.FormatLength());
+ ZeroMemory(mvih, mt.FormatLength());
mvih->hdr.bmiHeader.biSize = sizeof(mvih->hdr.bmiHeader);
mvih->hdr.bmiHeader.biWidth = biWidth;
mvih->hdr.bmiHeader.biHeight = biHeight;
@@ -604,7 +604,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.formattype = FORMAT_MPEG2Video;
{
MPEG2VIDEOINFO* mvih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + di->GetDataSize());
- memset(mvih, 0, mt.FormatLength());
+ ZeroMemory(mvih, mt.FormatLength());
mvih->hdr.bmiHeader.biSize = sizeof(mvih->hdr.bmiHeader);
mvih->hdr.bmiHeader.biWidth = biWidth;
mvih->hdr.bmiHeader.biHeight = biHeight;
@@ -667,7 +667,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.formattype = FORMAT_WaveFormatEx;
wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX) + di->GetDataSize());
- memset(wfe, 0, mt.FormatLength());
+ ZeroMemory(wfe, mt.FormatLength());
wfe->nSamplesPerSec = audio_desc->GetSampleRate();
wfe->nAvgBytesPerSec = audio_desc->GetAvgBitrate() / 8;
wfe->nChannels = audio_desc->GetChannelCount();
@@ -774,7 +774,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.subtype = MEDIASUBTYPE_VOBSUB;
mt.formattype = FORMAT_SubtitleInfo;
SUBTITLEINFO* si = (SUBTITLEINFO*)mt.AllocFormatBuffer(sizeof(SUBTITLEINFO) + hdr.GetLength());
- memset(si, 0, mt.FormatLength());
+ ZeroMemory(si, mt.FormatLength());
si->dwOffset = sizeof(SUBTITLEINFO);
strcpy_s(si->IsoLang, _countof(si->IsoLang), CStringA(TrackLanguage));
wcscpy_s(si->TrackName, _countof(si->TrackName), TrackName);
@@ -809,7 +809,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
m_framesize.cx,
m_framesize.cy);
SUBTITLEINFO* si = (SUBTITLEINFO*)mt.AllocFormatBuffer(sizeof(SUBTITLEINFO) + hdr.GetLength());
- memset(si, 0, mt.FormatLength());
+ ZeroMemory(si, mt.FormatLength());
si->dwOffset = sizeof(SUBTITLEINFO);
strcpy_s(si->IsoLang, _countof(si->IsoLang), CStringA(TrackLanguage));
wcscpy_s(si->TrackName, _countof(si->TrackName), TrackName);
@@ -844,7 +844,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* mvih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + size - 7);
- memset(mvih, 0, mt.FormatLength());
+ ZeroMemory(mvih, mt.FormatLength());
mvih->hdr.bmiHeader.biSize = sizeof(mvih->hdr.bmiHeader);
mvih->hdr.bmiHeader.biWidth = (LONG)avc1->GetWidth();
mvih->hdr.bmiHeader.biHeight = (LONG)avc1->GetHeight();
@@ -927,7 +927,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.majortype = MEDIATYPE_Video;
mt.formattype = FORMAT_VideoInfo;
vih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + db.GetDataSize());
- memset(vih, 0, mt.FormatLength());
+ ZeroMemory(vih, mt.FormatLength());
vih->bmiHeader.biSize = sizeof(vih->bmiHeader);
vih->bmiHeader.biWidth = (LONG)vse->GetWidth();
vih->bmiHeader.biHeight = (LONG)vse->GetHeight();
@@ -1088,7 +1088,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.majortype = MEDIATYPE_Audio;
mt.formattype = FORMAT_WaveFormatEx;
wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, mt.FormatLength());
+ ZeroMemory(wfe, mt.FormatLength());
if (!(fourcc & 0xffff0000)) {
wfe->wFormatTag = (WORD)fourcc;
}
@@ -1991,7 +1991,7 @@ HRESULT CMPEG4VideoSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.subtype = FOURCCMap('v4pm');
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* mvih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + m_seqhdrsize);
- memset(mvih, 0, mt.FormatLength());
+ ZeroMemory(mvih, mt.FormatLength());
mvih->hdr.bmiHeader.biSize = sizeof(mvih->hdr.bmiHeader);
mvih->hdr.bmiHeader.biWidth = width;
mvih->hdr.bmiHeader.biHeight = height;
diff --git a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
index 77857a7a0..9909ac57f 100644
--- a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
+++ b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
@@ -180,7 +180,7 @@ HRESULT CMatroskaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
if (CodecID == "V_MS/VFW/FOURCC") {
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + pTE->CodecPrivate.GetCount() - sizeof(BITMAPINFOHEADER));
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(&pvih->bmiHeader, pTE->CodecPrivate.GetData(), pTE->CodecPrivate.GetCount());
mt.subtype = FOURCCMap(pvih->bmiHeader.biCompression);
switch (pvih->bmiHeader.biCompression) {
@@ -265,7 +265,7 @@ avcsuccess:
mt.subtype = FOURCCMap('1CVA');
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* pm2vi = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + data.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
pm2vi->hdr.bmiHeader.biSize = sizeof(pm2vi->hdr.bmiHeader);
pm2vi->hdr.bmiHeader.biWidth = (LONG)pTE->v.PixelWidth;
pm2vi->hdr.bmiHeader.biHeight = (LONG)pTE->v.PixelHeight;
@@ -286,7 +286,7 @@ avcsuccess:
mt.subtype = FOURCCMap('V4PM');
mt.formattype = FORMAT_MPEG2Video;
MPEG2VIDEOINFO* pm2vi = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
pm2vi->hdr.bmiHeader.biSize = sizeof(pm2vi->hdr.bmiHeader);
pm2vi->hdr.bmiHeader.biWidth = (LONG)pTE->v.PixelWidth;
pm2vi->hdr.bmiHeader.biHeight = (LONG)pTE->v.PixelHeight;
@@ -304,7 +304,7 @@ avcsuccess:
mt.subtype = FOURCCMap('00VR' + ((CodecID[9] - 0x30) << 16));
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(mt.Format() + sizeof(VIDEOINFOHEADER), pTE->CodecPrivate.GetData(), pTE->CodecPrivate.GetCount());
pvih->bmiHeader.biSize = sizeof(pvih->bmiHeader);
pvih->bmiHeader.biWidth = (LONG)pTE->v.PixelWidth;
@@ -318,7 +318,7 @@ avcsuccess:
mt.subtype = MEDIASUBTYPE_DiracVideo;
mt.formattype = FORMAT_DiracVideoInfo;
DIRACINFOHEADER* dvih = (DIRACINFOHEADER*)mt.AllocFormatBuffer(FIELD_OFFSET(DIRACINFOHEADER, dwSequenceHeader) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
dvih->hdr.bmiHeader.biSize = sizeof(dvih->hdr.bmiHeader);
dvih->hdr.bmiHeader.biWidth = (LONG)pTE->v.PixelWidth;
dvih->hdr.bmiHeader.biHeight = (LONG)pTE->v.PixelHeight;
@@ -352,7 +352,7 @@ avcsuccess:
mt.subtype = FOURCCMap('OEHT');
mt.formattype = FORMAT_MPEG2_VIDEO;
MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(sizeof(MPEG2VIDEOINFO) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
vih->hdr.bmiHeader.biWidth = *(WORD*)&thdr[10] >> 4;
vih->hdr.bmiHeader.biHeight = *(WORD*)&thdr[12] >> 4;
@@ -379,7 +379,7 @@ avcsuccess:
mt.subtype = FOURCCMap('08PV');
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(mt.Format() + sizeof(VIDEOINFOHEADER), pTE->CodecPrivate.GetData(), pTE->CodecPrivate.GetCount());
pvih->bmiHeader.biSize = sizeof(pvih->bmiHeader);
pvih->bmiHeader.biWidth = (LONG)pTE->v.PixelWidth;
@@ -400,7 +400,7 @@ avcsuccess:
mt.subtype = FOURCCMap(*type);
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(mt.Format() + sizeof(VIDEOINFOHEADER), pTE->CodecPrivate.GetData(), pTE->CodecPrivate.GetCount());
pvih->bmiHeader.biSize = sizeof(pvih->bmiHeader);
pvih->bmiHeader.biWidth = (LONG)pTE->v.PixelWidth;
@@ -417,7 +417,7 @@ avcsuccess:
mt.formattype = FORMAT_MPEGVideo;
MPEG1VIDEOINFO* pm1vi = (MPEG1VIDEOINFO*)mt.AllocFormatBuffer(sizeof(MPEG1VIDEOINFO) + pTE->CodecPrivate.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(mt.Format() + sizeof(MPEG1VIDEOINFO), pTE->CodecPrivate.GetData(), pTE->CodecPrivate.GetCount());
pm1vi->hdr.bmiHeader.biSize = sizeof(pm1vi->hdr.bmiHeader);
@@ -561,7 +561,7 @@ avcsuccess:
mt.formattype = FORMAT_VideoInfo2;
mt.AllocFormatBuffer(vih2 + bmi);
memcpy(mt.Format(), mts[i].Format(), vih1);
- memset(mt.Format() + vih1, 0, vih2 - vih1);
+ ZeroMemory(mt.Format() + vih1, vih2 - vih1);
memcpy(mt.Format() + vih2, mts[i].Format() + vih1, bmi);
CSize aspect((int)pTE->v.DisplayWidth, (int)pTE->v.DisplayHeight);
@@ -591,7 +591,7 @@ avcsuccess:
mt.majortype = MEDIATYPE_Audio;
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, mt.FormatLength());
+ ZeroMemory(wfe, mt.FormatLength());
wfe->nChannels = (WORD)pTE->a.Channels;
wfe->nSamplesPerSec = (DWORD)pTE->a.SamplingFrequency;
wfe->wBitsPerSample = (WORD)pTE->a.BitDepth;
@@ -627,7 +627,7 @@ avcsuccess:
memcpy(p + 6, &wfe->nChannels, 2);
memcpy(p + 8, &wfe->wBitsPerSample, 2);
memcpy(p + 10, &wfe->nSamplesPerSec, 4);
- memset(p + 14, 0, 30 - 14);
+ ZeroMemory(p + 14, 30 - 14);
mts.Add(mt);
} else if (CodecID == "A_AAC") {
mt.subtype = FOURCCMap(wfe->wFormatTag = WAVE_FORMAT_AAC);
@@ -713,7 +713,7 @@ avcsuccess:
mt.subtype = MEDIASUBTYPE_Vorbis2;
mt.formattype = FORMAT_VorbisFormat2;
VORBISFORMAT2* pvf2 = (VORBISFORMAT2*)mt.AllocFormatBuffer(sizeof(VORBISFORMAT2) + (ULONG)totalsize);
- memset(pvf2, 0, mt.FormatLength());
+ ZeroMemory(pvf2, mt.FormatLength());
pvf2->Channels = (WORD)pTE->a.Channels;
pvf2->SamplesPerSec = (DWORD)pTE->a.SamplingFrequency;
pvf2->BitsPerSample = (DWORD)pTE->a.BitDepth;
@@ -728,7 +728,7 @@ avcsuccess:
mt.subtype = MEDIASUBTYPE_Vorbis;
mt.formattype = FORMAT_VorbisFormat;
VORBISFORMAT* vf = (VORBISFORMAT*)mt.AllocFormatBuffer(sizeof(VORBISFORMAT));
- memset(vf, 0, mt.FormatLength());
+ ZeroMemory(vf, mt.FormatLength());
vf->nChannels = (WORD)pTE->a.Channels;
vf->nSamplesPerSec = (DWORD)pTE->a.SamplingFrequency;
vf->nMinBitsPerSec = vf->nMaxBitsPerSec = vf->nAvgBitsPerSec = (DWORD) - 1;
@@ -789,7 +789,7 @@ avcsuccess:
wfe = (WAVEFORMATEX*)mt.ReallocFormatBuffer(sizeof(WAVEFORMATEX) + cbSize);
BYTE* p = (BYTE*)(wfe + 1);
- memset(p, 0, cbSize);
+ ZeroMemory(p, cbSize);
memcpy(p + 3, &cbSize, 1);
memcpy(p + 4, (const unsigned char*)"alac", 4);
memcpy(p + 12, pTE->CodecPrivate.GetData(), pTE->CodecPrivate.GetCount());
@@ -814,7 +814,7 @@ avcsuccess:
mt.majortype = MEDIATYPE_Subtitle;
mt.formattype = FORMAT_SubtitleInfo;
SUBTITLEINFO* psi = (SUBTITLEINFO*)mt.AllocFormatBuffer(sizeof(SUBTITLEINFO) + pTE->CodecPrivate.GetCount());
- memset(psi, 0, mt.FormatLength());
+ ZeroMemory(psi, mt.FormatLength());
strncpy_s(psi->IsoLang, pTE->Language, _countof(psi->IsoLang) - 1);
CString subtitle_Name = pTE->Name;
if (pTE->FlagForced) { // "Forced" overrides "Default"
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
index 1f301e345..136c663e0 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
@@ -221,7 +221,7 @@ CString GetMediaTypeDesc(const CMediaType* _pMediaType, const CHdmvClipInfo::Str
bIsMPEG2 = true;
} else {
WCHAR Temp[5];
- memset(Temp, 0, sizeof(Temp));
+ ZeroMemory(Temp, sizeof(Temp));
Temp[0] = (pInfo->hdr.bmiHeader.biCompression >> 0) & 0xFF;
Temp[1] = (pInfo->hdr.bmiHeader.biCompression >> 8) & 0xFF;
Temp[2] = (pInfo->hdr.bmiHeader.biCompression >> 16) & 0xFF;
@@ -294,7 +294,7 @@ CString GetMediaTypeDesc(const CMediaType* _pMediaType, const CHdmvClipInfo::Str
Infos.AddTail(L"VC-1");
} else if (CodecType) {
WCHAR Temp[5];
- memset(Temp, 0, sizeof(Temp));
+ ZeroMemory(Temp, sizeof(Temp));
Temp[0] = (CodecType >> 0) & 0xFF;
Temp[1] = (CodecType >> 8) & 0xFF;
Temp[2] = (CodecType >> 16) & 0xFF;
@@ -513,13 +513,13 @@ CMpegSplitterFilter::CMpegSplitterFilter(LPUNKNOWN pUnk, HRESULT* phr, const CLS
}
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS == key.QueryStringValue(_T("AudioLanguageOrder"), buff, &len)) {
m_csAudioLanguageOrder = CString(buff);
}
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS == key.QueryStringValue(_T("SubtitlesLanguageOrder"), buff, &len)) {
m_csSubtitlesLanguageOrder = CString(buff);
}
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
index 38c79f71f..777fc0169 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
@@ -563,7 +563,7 @@ DWORD CMpegSplitterFile::AddStream(WORD pid, BYTE pesid, BYTE ps1id, DWORD len)
// PPS and SPS can be present on differents packets
// and can also be split into multiple packets
if (!avch.Lookup(pid)) {
- memset(&avch[pid], 0, sizeof(CMpegSplitterFile::avchdr));
+ ZeroMemory(&avch[pid], sizeof(CMpegSplitterFile::avchdr));
}
#if defined(MVC_SUPPORT)
if (!m_streams[video].Find(s) && !m_streams[stereo].Find(s) && Read(avch[pid], len, &s.mt)) {
@@ -959,7 +959,7 @@ void CMpegSplitterFile::UpdatePrograms(const tshdr& h, bool UpdateLang)
int max_len = h.bytes - 9;
if (len > max_len) {
- memset(pPair->m_value.ts_buffer, 0, sizeof(pPair->m_value.ts_buffer));
+ ZeroMemory(pPair->m_value.ts_buffer, sizeof(pPair->m_value.ts_buffer));
pPair->m_value.ts_len_cur = max_len;
pPair->m_value.ts_len_packet = len;
memcpy(pPair->m_value.ts_buffer, buffer, max_len);
@@ -987,7 +987,7 @@ void CMpegSplitterFile::UpdatePrograms(const tshdr& h, bool UpdateLang)
void CMpegSplitterFile::UpdatePrograms(CGolombBuffer gb, WORD pid, bool UpdateLang)
{
if (CAtlMap<WORD, program>::CPair* pPair = m_programs.Lookup(pid)) {
- memset(pPair->m_value.streams, 0, sizeof(pPair->m_value.streams));
+ ZeroMemory(pPair->m_value.streams, sizeof(pPair->m_value.streams));
int len = gb.GetSize();
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.h b/src/filters/parser/MpegSplitter/MpegSplitterFile.h
index d76b5899c..38a7c813e 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitterFile.h
+++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.h
@@ -160,7 +160,7 @@ public:
};
stream streams[64];
struct program() {
- memset(this, 0, sizeof(*this));
+ ZeroMemory(this, sizeof(*this));
}
BYTE ts_buffer[1024];
diff --git a/src/filters/parser/OggSplitter/OggFile.cpp b/src/filters/parser/OggSplitter/OggFile.cpp
index 90176e80d..eebab48a1 100644
--- a/src/filters/parser/OggSplitter/OggFile.cpp
+++ b/src/filters/parser/OggSplitter/OggFile.cpp
@@ -68,7 +68,7 @@ bool COggFile::Read(OggPageHeader& hdr, HANDLE hBreak)
bool COggFile::Read(OggPage& page, bool fFull, HANDLE hBreak)
{
- memset(&page.m_hdr, 0, sizeof(page.m_hdr));
+ ZeroMemory(&page.m_hdr, sizeof(page.m_hdr));
page.m_lens.RemoveAll();
page.SetCount(0);
diff --git a/src/filters/parser/OggSplitter/OggFile.h b/src/filters/parser/OggSplitter/OggFile.h
index b609e3be3..4c7cff2c4 100644
--- a/src/filters/parser/OggSplitter/OggFile.h
+++ b/src/filters/parser/OggSplitter/OggFile.h
@@ -80,7 +80,7 @@ public:
OggPageHeader m_hdr;
CAtlList<int> m_lens;
OggPage() {
- memset(&m_hdr, 0, sizeof(m_hdr));
+ ZeroMemory(&m_hdr, sizeof(m_hdr));
}
};
diff --git a/src/filters/parser/OggSplitter/OggSplitter.cpp b/src/filters/parser/OggSplitter/OggSplitter.cpp
index 931cdf971..39ed7ee1b 100644
--- a/src/filters/parser/OggSplitter/OggSplitter.cpp
+++ b/src/filters/parser/OggSplitter/OggSplitter.cpp
@@ -799,7 +799,7 @@ COggVorbisOutputPin::COggVorbisOutputPin(OggVorbisIdHeader* h, LPCWSTR pName, CB
mt.subtype = MEDIASUBTYPE_Vorbis;
mt.formattype = FORMAT_VorbisFormat;
VORBISFORMAT* vf = (VORBISFORMAT*)mt.AllocFormatBuffer(sizeof(VORBISFORMAT));
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
vf->nChannels = h->audio_channels;
vf->nSamplesPerSec = h->audio_sample_rate;
vf->nAvgBitsPerSec = h->bitrate_nominal;
@@ -814,7 +814,7 @@ COggVorbisOutputPin::COggVorbisOutputPin(OggVorbisIdHeader* h, LPCWSTR pName, CB
mt.subtype = MEDIASUBTYPE_Vorbis2;
mt.formattype = FORMAT_VorbisFormat2;
VORBISFORMAT2* vf2 = (VORBISFORMAT2*)mt.AllocFormatBuffer(sizeof(VORBISFORMAT2));
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
vf2->Channels = h->audio_channels;
vf2->SamplesPerSec = h->audio_sample_rate;
mt.SetSampleSize(8192);
@@ -966,7 +966,7 @@ COggFlacOutputPin::COggFlacOutputPin(BYTE* h, int nCount, LPCWSTR pName, CBaseFi
mt.subtype = MEDIASUBTYPE_FLAC_FRAMED;
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->cbSize = sizeof(WAVEFORMATEX);
wfe->wFormatTag = WAVE_FORMAT_FLAC;
wfe->nSamplesPerSec = m_nSamplesPerSec;
@@ -1149,7 +1149,7 @@ COggVideoOutputPin::COggVideoOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseF
mt.subtype = FOURCCMap(MAKEFOURCC(h->subtype[0], h->subtype[1], h->subtype[2], h->subtype[3]));
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + extra);
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(mt.Format() + sizeof(VIDEOINFOHEADER), h + 1, extra);
pvih->AvgTimePerFrame = h->time_unit / h->samples_per_unit;
pvih->bmiHeader.biWidth = h->v.w;
@@ -1194,7 +1194,7 @@ COggAudioOutputPin::COggAudioOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseF
mt.subtype = FOURCCMap(strtol(CStringA(h->subtype, 4), nullptr, 16));
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX) + extra);
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(mt.Format() + sizeof(WAVEFORMATEX), h + 1, extra);
wfe->cbSize = extra;
wfe->wFormatTag = (WORD)mt.subtype.Data1;
@@ -1232,7 +1232,7 @@ COggTheoraOutputPin::COggTheoraOutputPin(BYTE* p, LPCWSTR pName, CBaseFilter* pF
mt.subtype = FOURCCMap('OEHT');
mt.formattype = FORMAT_MPEG2_VIDEO;
MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(sizeof(MPEG2VIDEOINFO));
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
vih->hdr.bmiHeader.biWidth = *(WORD*)&p[10] >> 4;
vih->hdr.bmiHeader.biHeight = *(WORD*)&p[12] >> 4;
diff --git a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
index 30e524d71..75adca484 100644
--- a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
+++ b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
@@ -260,7 +260,7 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + (ULONG)pmp->typeSpecData.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(pvih + 1, pmp->typeSpecData.GetData(), pmp->typeSpecData.GetCount());
rvinfo rvi = *(rvinfo*)pmp->typeSpecData.GetData();
@@ -298,7 +298,7 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
BITMAPINFOHEADER bmi = pvih->bmiHeader;
mt.formattype = FORMAT_VideoInfo2;
VIDEOINFOHEADER2* pvih2 = (VIDEOINFOHEADER2*)mt.ReallocFormatBuffer(sizeof(VIDEOINFOHEADER2) + (ULONG)pmp->typeSpecData.GetCount());
- memset(mt.Format() + FIELD_OFFSET(VIDEOINFOHEADER2, dwInterlaceFlags), 0, mt.FormatLength() - FIELD_OFFSET(VIDEOINFOHEADER2, dwInterlaceFlags));
+ ZeroMemory(mt.Format() + FIELD_OFFSET(VIDEOINFOHEADER2, dwInterlaceFlags), mt.FormatLength() - FIELD_OFFSET(VIDEOINFOHEADER2, dwInterlaceFlags));
memcpy(pvih2 + 1, pmp->typeSpecData.GetData(), pmp->typeSpecData.GetCount());
pvih2->bmiHeader = bmi;
pvih2->bmiHeader.biWidth = (DWORD)pmp->width;
@@ -314,7 +314,7 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.bTemporalCompression = 1;
WAVEFORMATEX* pwfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX) + (ULONG)pmp->typeSpecData.GetCount());
- memset(mt.Format(), 0, mt.FormatLength());
+ ZeroMemory(mt.Format(), mt.FormatLength());
memcpy(pwfe + 1, pmp->typeSpecData.GetData(), pmp->typeSpecData.GetCount());
union {
@@ -1078,7 +1078,7 @@ HRESULT CRMFile::Read(T& var)
HRESULT CRMFile::Read(ChunkHdr& hdr)
{
- memset(&hdr, 0, sizeof(hdr));
+ ZeroMemory(&hdr, sizeof(hdr));
HRESULT hr;
if (S_OK != (hr = Read(hdr.object_id))
|| S_OK != (hr = Read(hdr.size))
@@ -1090,7 +1090,7 @@ HRESULT CRMFile::Read(ChunkHdr& hdr)
HRESULT CRMFile::Read(MediaPacketHeader& mph, bool fFull)
{
- memset(&mph, 0, FIELD_OFFSET(MediaPacketHeader, pData));
+ ZeroMemory(&mph, FIELD_OFFSET(MediaPacketHeader, pData));
mph.stream = (UINT16) - 1;
HRESULT hr;
@@ -1760,7 +1760,7 @@ HRESULT CRealVideoDecoder::Transform(IMediaSample* pIn)
m_pI420 = static_cast<BYTE*>(_aligned_malloc(size * 3 / 2, 16));
if (m_pI420) {
TRACE(_T(" m_pI420.Allocated 1"));
- memset(m_pI420, 0, size);
+ ZeroMemory(m_pI420, size);
TRACE(_T(" m_pI420.Allocated 2"));
memset(m_pI420 + size, 0x80, size / 2);
TRACE(_T(" m_pI420.Allocated 3"));
@@ -1771,7 +1771,7 @@ HRESULT CRealVideoDecoder::Transform(IMediaSample* pIn)
m_pI420Tmp = static_cast<BYTE*>(_aligned_malloc(size * 3 / 2, 16));
if (m_pI420Tmp) {
TRACE(_T(" m_pI420Tmp.Allocated 1"));
- memset(m_pI420Tmp, 0, size);
+ ZeroMemory(m_pI420Tmp, size);
TRACE(_T(" m_pI420Tmp.Allocated 2"));
memset(m_pI420Tmp + size, 0x80, size / 2);
TRACE(_T(" m_pI420Tmp.Allocated 3"));
@@ -2052,10 +2052,10 @@ HRESULT CRealVideoDecoder::StartStreaming()
int size = m_w * m_h;
m_lastBuffSizeDim = size;
m_pI420 = static_cast<BYTE*>(_aligned_malloc(size * 3 / 2, 16));
- memset(m_pI420, 0, size);
+ ZeroMemory(m_pI420, size);
memset(m_pI420 + size, 0x80, size / 2);
m_pI420Tmp = static_cast<BYTE*>(_aligned_malloc(size * 3 / 2, 16));
- memset(m_pI420Tmp, 0, size);
+ ZeroMemory(m_pI420Tmp, size);
memset(m_pI420Tmp + size, 0x80, size / 2);
return __super::StartStreaming();
diff --git a/src/filters/reader/CDDAReader/CDDAReader.cpp b/src/filters/reader/CDDAReader/CDDAReader.cpp
index f5ce61e46..04949477a 100644
--- a/src/filters/reader/CDDAReader/CDDAReader.cpp
+++ b/src/filters/reader/CDDAReader/CDDAReader.cpp
@@ -245,10 +245,10 @@ CCDDAStream::CCDDAStream()
m_llPosition = m_llLength = 0;
- memset(&m_TOC, 0, sizeof(m_TOC));
+ ZeroMemory(&m_TOC, sizeof(m_TOC));
m_nStartSector = m_nStopSector = 0;
- memset(&m_header, 0, sizeof(m_header));
+ ZeroMemory(&m_header, sizeof(m_header));
m_header.riff.hdr.chunkID = RIFFID;
m_header.riff.WAVE = WAVEID;
m_header.frm.hdr.chunkID = FormatID;
@@ -329,7 +329,7 @@ bool CCDDAStream::Load(const WCHAR* fnw)
do {
CDROM_READ_TOC_EX TOCEx;
- memset(&TOCEx, 0, sizeof(TOCEx));
+ ZeroMemory(&TOCEx, sizeof(TOCEx));
TOCEx.Format = CDROM_READ_TOC_EX_FORMAT_CDTEXT;
TOCEx.SessionTrack = iTrackIndex;
WORD size = 0;
@@ -342,7 +342,7 @@ bool CCDDAStream::Load(const WCHAR* fnw)
CAutoVectorPtr<BYTE> pCDTextData;
pCDTextData.Allocate(size);
- memset(pCDTextData, 0, size);
+ ZeroMemory(pCDTextData, size);
if (!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC_EX, &TOCEx, sizeof(TOCEx), pCDTextData, size, &BytesReturned, 0)) {
break;
diff --git a/src/filters/reader/CDXAReader/CDXAReader.cpp b/src/filters/reader/CDXAReader/CDXAReader.cpp
index b98611854..79b8a02eb 100644
--- a/src/filters/reader/CDXAReader/CDXAReader.cpp
+++ b/src/filters/reader/CDXAReader/CDXAReader.cpp
@@ -298,7 +298,7 @@ HRESULT CCDXAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
FilePointer.QuadPart = RIFFCDXA_HEADER_SIZE + sector * RAW_SECTOR_SIZE;
SetFilePointerEx(m_hFile, FilePointer, &FilePointer, FILE_BEGIN);
- memset(m_sector, 0, sizeof(m_sector));
+ ZeroMemory(m_sector, sizeof(m_sector));
DWORD NumberOfBytesRead = 0;
diff --git a/src/filters/reader/UDPReader/UDPReader.cpp b/src/filters/reader/UDPReader/UDPReader.cpp
index 1e1e73cd6..c925d28d1 100644
--- a/src/filters/reader/UDPReader/UDPReader.cpp
+++ b/src/filters/reader/UDPReader/UDPReader.cpp
@@ -258,7 +258,7 @@ HRESULT CUDPStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
if (m_pos < p->m_start) {
ASSERT(0);
size = (DWORD)min(len, p->m_start - m_pos);
- memset(ptr, 0, size);
+ ZeroMemory(ptr, size);
} else {
size = (DWORD)min(len, p->m_end - m_pos);
memcpy(ptr, &p->m_buff[m_pos - p->m_start], size);
@@ -316,7 +316,7 @@ DWORD CUDPStream::ThreadProc()
WSAStartup(MAKEWORD(2, 2), &wsaData);
sockaddr_in addr;
- memset(&addr, 0, sizeof(addr));
+ ZeroMemory(&addr, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons((u_short)m_port);
@@ -422,7 +422,7 @@ DWORD CUDPStream::ThreadProc()
static BYTE pid2counter[0x2000];
static bool init = false;
if (!init) {
- memset(pid2counter, 0, sizeof(pid2counter));
+ ZeroMemory(pid2counter, sizeof(pid2counter));
init = true;
}
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
index 08cd455fa..0278ee2e5 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
@@ -127,7 +127,7 @@ CMpcAudioRenderer::CMpcAudioRenderer(LPUNKNOWN punk, HRESULT* phr)
m_bMuteFastForward = !!dw;
}
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS == key.QueryStringValue(_T("SoundDevice"), buff, &len)) {
m_csSound_Device = CString(buff);
}
@@ -721,7 +721,7 @@ HRESULT CMpcAudioRenderer::ClearBuffer()
hr = m_pDSBuffer->Lock(0, 0, &pDSLockedBuffer, &dwDSLockedSize, nullptr, nullptr, DSBLOCK_ENTIREBUFFER);
if (SUCCEEDED(hr)) {
- memset(pDSLockedBuffer, 0, dwDSLockedSize);
+ ZeroMemory(pDSLockedBuffer, dwDSLockedSize);
hr = m_pDSBuffer->Unlock(pDSLockedBuffer, dwDSLockedSize, nullptr, 0);
}
}
diff --git a/src/filters/renderer/VideoRenderers/D3DFont.cpp b/src/filters/renderer/VideoRenderers/D3DFont.cpp
index 5d32b8edc..0dc8a48fe 100644
--- a/src/filters/renderer/VideoRenderers/D3DFont.cpp
+++ b/src/filters/renderer/VideoRenderers/D3DFont.cpp
@@ -276,7 +276,7 @@ HRESULT CD3DFont::InitDeviceObjects(LPDIRECT3DDEVICE9 pd3dDevice)
}
// Prepare to create a bitmap
- DWORD* pBitmapBits;
+ DWORD* pBitmapBits;
BITMAPINFO bmi;
ZeroMemory(&bmi.bmiHeader, sizeof(BITMAPINFOHEADER));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
index 6d58231da..6070ba7e3 100644
--- a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
@@ -491,7 +491,7 @@ STDMETHODIMP CDX7AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
}
BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)lpDib;
- memset(bih, 0, sizeof(BITMAPINFOHEADER));
+ ZeroMemory(bih, sizeof(BITMAPINFOHEADER));
bih->biSize = sizeof(BITMAPINFOHEADER);
bih->biWidth = ddsd.dwWidth;
bih->biHeight = ddsd.dwHeight;
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
index 42c986382..52472d80f 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
@@ -131,7 +131,6 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
ZeroMemory(m_DetectedFrameTimeHistoryHistory, sizeof(m_DetectedFrameTimeHistoryHistory));
m_DetectedFrameTimePos = 0;
ZeroMemory(&m_VMR9AlphaBitmap, sizeof(m_VMR9AlphaBitmap));
-
ZeroMemory(m_ldDetectedRefreshRateList, sizeof(m_ldDetectedRefreshRateList));
ZeroMemory(m_ldDetectedScanlineRateList, sizeof(m_ldDetectedScanlineRateList));
m_DetectedRefreshRatePos = 0;
@@ -152,8 +151,8 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
hr = CreateDevice(_Error);
- memset(m_pllJitter, 0, sizeof(m_pllJitter));
- memset(m_pllSyncOffset, 0, sizeof(m_pllSyncOffset));
+ ZeroMemory(m_pllJitter, sizeof(m_pllJitter));
+ ZeroMemory(m_pllSyncOffset, sizeof(m_pllSyncOffset));
m_nNextJitter = 0;
m_nNextSyncOffset = 0;
m_llLastPerf = 0;
@@ -2117,7 +2116,7 @@ STDMETHODIMP CDX9AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
HRESULT hr;
D3DSURFACE_DESC desc;
- memset(&desc, 0, sizeof(desc));
+ ZeroMemory(&desc, sizeof(desc));
m_pVideoSurface[m_nCurSurface]->GetDesc(&desc);
DWORD required = sizeof(BITMAPINFOHEADER) + (desc.Width * desc.Height * 32 >> 3);
@@ -2160,7 +2159,7 @@ STDMETHODIMP CDX9AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
}
BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)lpDib;
- memset(bih, 0, sizeof(BITMAPINFOHEADER));
+ ZeroMemory(bih, sizeof(BITMAPINFOHEADER));
bih->biSize = sizeof(BITMAPINFOHEADER);
bih->biWidth = desc.Width;
bih->biHeight = desc.Height;
diff --git a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
index a8fb4e20d..7636c64c2 100644
--- a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
@@ -1495,13 +1495,13 @@ HRESULT CDX9RenderingEngine::TextureCopy(IDirect3DTexture9* pTexture)
bool CDX9RenderingEngine::ClipToSurface(IDirect3DSurface9* pSurface, CRect& s, CRect& d)
{
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(pSurface->GetDesc(&d3dsd))) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(pSurface->GetDesc(&desc))) {
return false;
}
- int w = d3dsd.Width, h = d3dsd.Height;
+ int w = desc.Width, h = desc.Height;
int sw = s.Width(), sh = s.Height();
int dw = d.Width(), dh = d.Height();
@@ -1586,14 +1586,14 @@ HRESULT CDX9RenderingEngine::AlphaBlt(const RECT* pSrc, const RECT* pDst, IDirec
HRESULT hr;
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(pTexture->GetLevelDesc(0, &d3dsd)) /*|| d3dsd.Type != D3DRTYPE_TEXTURE*/) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(pTexture->GetLevelDesc(0, &desc)) /*|| desc.Type != D3DRTYPE_TEXTURE*/) {
return E_FAIL;
}
- float w = (float)d3dsd.Width;
- float h = (float)d3dsd.Height;
+ float w = (float)desc.Width;
+ float h = (float)desc.Height;
// Be careful with the code that follows. Some compilers (e.g. Visual Studio 2012) used to miscompile
// it in some cases (namely x64 with optimizations /O2 /Ot). This bug led pVertices not to be correctly
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
index 0409668ce..17b95c366 100644
--- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
@@ -1113,7 +1113,7 @@ bool CEVRAllocatorPresenter::GetImageFromMixer()
break;
}
- memset(&Buffer, 0, sizeof(Buffer));
+ ZeroMemory(&Buffer, sizeof(Buffer));
Buffer.pSample = pSample;
pSample->GetUINT32(GUID_SURFACE_INDEX, &dwSurface);
@@ -1269,8 +1269,8 @@ STDMETHODIMP CEVRAllocatorPresenter::GetIdealVideoSize(SIZE* pszMin, SIZE* pszMa
if (pszMax) {
D3DDISPLAYMODE d3ddm;
-
ZeroMemory(&d3ddm, sizeof(d3ddm));
+
if (SUCCEEDED(m_pD3D->GetAdapterDisplayMode(GetAdapter(m_pD3D), &d3ddm))) {
pszMax->cx = d3ddm.Width;
pszMax->cy = d3ddm.Height;
@@ -1942,7 +1942,6 @@ STDMETHODIMP_(bool) CEVRAllocatorPresenter::DisplayChange()
ZeroMemory(m_DetectedFrameTimeHistoryHistory, sizeof(m_DetectedFrameTimeHistoryHistory));
m_DetectedFrameTimePos = 0;
ZeroMemory(&m_VMR9AlphaBitmap, sizeof(m_VMR9AlphaBitmap));
-
ZeroMemory(m_ldDetectedRefreshRateList, sizeof(m_ldDetectedRefreshRateList));
ZeroMemory(m_ldDetectedScanlineRateList, sizeof(m_ldDetectedScanlineRateList));
m_DetectedRefreshRatePos = 0;
@@ -1951,8 +1950,8 @@ STDMETHODIMP_(bool) CEVRAllocatorPresenter::DisplayChange()
m_DetectedScanlineTimePrim = 0;
m_DetectedRefreshRate = 0;
- memset(m_pllJitter, 0, sizeof(m_pllJitter));
- memset(m_pllSyncOffset, 0, sizeof(m_pllSyncOffset));
+ ZeroMemory(m_pllJitter, sizeof(m_pllJitter));
+ ZeroMemory(m_pllSyncOffset, sizeof(m_pllSyncOffset));
m_nNextJitter = 0;
m_nNextSyncOffset = 0;
m_llLastPerf = 0;
diff --git a/src/filters/renderer/VideoRenderers/IPinHook.cpp b/src/filters/renderer/VideoRenderers/IPinHook.cpp
index 3f5cb4e97..8e0c3cac3 100644
--- a/src/filters/renderer/VideoRenderers/IPinHook.cpp
+++ b/src/filters/renderer/VideoRenderers/IPinHook.cpp
@@ -1082,7 +1082,7 @@ private:
public:
CFakeDirectXVideoDecoder(LPUNKNOWN pUnk, IDirectXVideoDecoder* pDec) : CUnknown(_T("Fake DXVA2 Dec"), pUnk) {
m_pDec.Attach(pDec);
- memset(m_ppBuffer, 0, sizeof(m_ppBuffer));
+ ZeroMemory(m_ppBuffer, sizeof(m_ppBuffer));
}
~CFakeDirectXVideoDecoder() {
@@ -1373,7 +1373,7 @@ static void LogVideoCardCaps(IDirectXVideoDecoderService* pDecoderService)
for (UINT iFormat = 0; iFormat < cFormats; iFormat++) {
LOG(_T("Direct 3D format : %s"), FindD3DFormat(pFormats[iFormat]));
// Fill in the video description. Set the width, height, format, and frame rate.
- memset(&m_VideoDesc, 0, sizeof(m_VideoDesc));
+ ZeroMemory(&m_VideoDesc, sizeof(m_VideoDesc));
m_VideoDesc.SampleWidth = 1280;
m_VideoDesc.SampleHeight = 720;
m_VideoDesc.Format = pFormats[iFormat];
diff --git a/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp
index e4769a3b0..73f154159 100644
--- a/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp
@@ -85,9 +85,9 @@ STDMETHODIMP CQT9AllocatorPresenter::DoBlt(const BITMAP& bm)
bool fOk = false;
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(m_pVideoSurfaceOff->GetDesc(&d3dsd))) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(m_pVideoSurfaceOff->GetDesc(&desc))) {
return E_FAIL;
}
@@ -95,10 +95,10 @@ STDMETHODIMP CQT9AllocatorPresenter::DoBlt(const BITMAP& bm)
UINT h = abs(bm.bmHeight);
int bpp = bm.bmBitsPixel;
int dbpp =
- d3dsd.Format == D3DFMT_R8G8B8 || d3dsd.Format == D3DFMT_X8R8G8B8 || d3dsd.Format == D3DFMT_A8R8G8B8 ? 32 :
- d3dsd.Format == D3DFMT_R5G6B5 ? 16 : 0;
+ desc.Format == D3DFMT_R8G8B8 || desc.Format == D3DFMT_X8R8G8B8 || desc.Format == D3DFMT_A8R8G8B8 ? 32 :
+ desc.Format == D3DFMT_R5G6B5 ? 16 : 0;
- if ((bpp == 16 || bpp == 24 || bpp == 32) && w == d3dsd.Width && h == d3dsd.Height) {
+ if ((bpp == 16 || bpp == 24 || bpp == 32) && w == desc.Width && h == desc.Height) {
D3DLOCKED_RECT r;
if (SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, nullptr, 0))) {
BitBltFromRGBToRGB(
diff --git a/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp
index 1e03c97ab..b063cb1b3 100644
--- a/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp
@@ -97,15 +97,15 @@ STDMETHODIMP CRM9AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
return E_FAIL;
}
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(m_pVideoSurfaceOff->GetDesc(&d3dsd))) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(m_pVideoSurfaceOff->GetDesc(&desc))) {
return E_FAIL;
}
int dbpp =
- d3dsd.Format == D3DFMT_R8G8B8 || d3dsd.Format == D3DFMT_X8R8G8B8 || d3dsd.Format == D3DFMT_A8R8G8B8 ? 32 :
- d3dsd.Format == D3DFMT_R5G6B5 ? 16 : 0;
+ desc.Format == D3DFMT_R8G8B8 || desc.Format == D3DFMT_X8R8G8B8 || desc.Format == D3DFMT_A8R8G8B8 ? 32 :
+ desc.Format == D3DFMT_R5G6B5 ? 16 : 0;
if (pBitmapInfo->biCompression == '024I') {
DWORD pitch = pBitmapInfo->biWidth;
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
index 8898d8422..fc2f5f7a2 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
@@ -164,8 +164,8 @@ CBaseAP::CBaseAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error):
m_pGenlock = DEBUG_NEW CGenlock(r.m_AdvRendSets.fTargetSyncOffset, r.m_AdvRendSets.fControlLimit, r.m_AdvRendSets.iLineDelta, r.m_AdvRendSets.iColumnDelta, r.m_AdvRendSets.fCycleDelta, 0); // Must be done before CreateDXDevice
hr = CreateDXDevice(_Error);
- memset(m_pllJitter, 0, sizeof(m_pllJitter));
- memset(m_pllSyncOffset, 0, sizeof(m_pllSyncOffset));
+ ZeroMemory(m_pllJitter, sizeof(m_pllJitter));
+ ZeroMemory(m_pllSyncOffset, sizeof(m_pllSyncOffset));
}
CBaseAP::~CBaseAP()
@@ -1003,13 +1003,13 @@ STDMETHODIMP CBaseAP::CreateRenderer(IUnknown** ppRenderer)
bool CBaseAP::ClipToSurface(IDirect3DSurface9* pSurface, CRect& s, CRect& d)
{
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(pSurface->GetDesc(&d3dsd))) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(pSurface->GetDesc(&desc))) {
return false;
}
- int w = d3dsd.Width, h = d3dsd.Height;
+ int w = desc.Width, h = desc.Height;
int sw = s.Width(), sh = s.Height();
int dw = d.Width(), dh = d.Height();
@@ -1379,14 +1379,14 @@ HRESULT CBaseAP::AlphaBlt(RECT* pSrc, const RECT* pDst, IDirect3DTexture9* pText
HRESULT hr;
do {
- D3DSURFACE_DESC d3dsd;
- ZeroMemory(&d3dsd, sizeof(d3dsd));
- if (FAILED(pTexture->GetLevelDesc(0, &d3dsd)) /*|| d3dsd.Type != D3DRTYPE_TEXTURE*/) {
+ D3DSURFACE_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ if (FAILED(pTexture->GetLevelDesc(0, &desc)) /*|| desc.Type != D3DRTYPE_TEXTURE*/) {
break;
}
- float w = (float)d3dsd.Width;
- float h = (float)d3dsd.Height;
+ float w = (float)desc.Width;
+ float h = (float)desc.Height;
// Be careful with the code that follows. Some compilers (e.g. Visual Studio 2012) used to miscompile
// it in some cases (namely x64 with optimizations /O2 /Ot). This bug led pVertices not to be correctly
@@ -2331,7 +2331,7 @@ STDMETHODIMP CBaseAP::GetDIB(BYTE* lpDib, DWORD* size)
HRESULT hr;
D3DSURFACE_DESC desc;
- memset(&desc, 0, sizeof(desc));
+ ZeroMemory(&desc, sizeof(desc));
m_pVideoSurface[m_nCurSurface]->GetDesc(&desc);
DWORD required = sizeof(BITMAPINFOHEADER) + (desc.Width * desc.Height * 32 >> 3);
@@ -2356,7 +2356,7 @@ STDMETHODIMP CBaseAP::GetDIB(BYTE* lpDib, DWORD* size)
}
BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)lpDib;
- memset(bih, 0, sizeof(BITMAPINFOHEADER));
+ ZeroMemory(bih, sizeof(BITMAPINFOHEADER));
bih->biSize = sizeof(BITMAPINFOHEADER);
bih->biWidth = desc.Width;
bih->biHeight = desc.Height;
@@ -3183,7 +3183,7 @@ bool CSyncAP::GetSampleFromMixer()
break;
}
- memset(&Buffer, 0, sizeof(Buffer));
+ ZeroMemory(&Buffer, sizeof(Buffer));
Buffer.pSample = pSample;
pSample->GetUINT32(GUID_SURFACE_INDEX, &dwSurface);
{
@@ -3306,17 +3306,17 @@ STDMETHODIMP CSyncAP::GetNativeVideoSize(SIZE* pszVideo, SIZE* pszARVideo)
STDMETHODIMP CSyncAP::GetIdealVideoSize(SIZE* pszMin, SIZE* pszMax)
{
if (pszMin) {
- pszMin->cx = 1;
- pszMin->cy = 1;
+ pszMin->cx = 1;
+ pszMin->cy = 1;
}
if (pszMax) {
- D3DDISPLAYMODE d3ddm;
-
+ D3DDISPLAYMODE d3ddm;
ZeroMemory(&d3ddm, sizeof(d3ddm));
+
if (SUCCEEDED(m_pD3D->GetAdapterDisplayMode(GetAdapter(m_pD3D, m_hWnd), &d3ddm))) {
- pszMax->cx = d3ddm.Width;
- pszMax->cy = d3ddm.Height;
+ pszMax->cx = d3ddm.Width;
+ pszMax->cy = d3ddm.Height;
}
}
return S_OK;
diff --git a/src/filters/source/D2VSource/D2VSource.cpp b/src/filters/source/D2VSource/D2VSource.cpp
index f466d4da9..a40a158ab 100644
--- a/src/filters/source/D2VSource/D2VSource.cpp
+++ b/src/filters/source/D2VSource/D2VSource.cpp
@@ -235,7 +235,7 @@ HRESULT CD2VStream::GetMediaType(int iPosition, CMediaType* pmt)
pmt->SetTemporalCompression(FALSE);
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(vih, 0, sizeof(VIDEOINFOHEADER));
+ ZeroMemory(vih, sizeof(VIDEOINFOHEADER));
vih->AvgTimePerFrame = m_AvgTimePerFrame;
vih->bmiHeader.biSize = sizeof(vih->bmiHeader);
vih->bmiHeader.biWidth = m_pDecoder->Clip_Width;
diff --git a/src/filters/source/FLACSource/FLACSource.cpp b/src/filters/source/FLACSource/FLACSource.cpp
index b833f573f..c6db94211 100644
--- a/src/filters/source/FLACSource/FLACSource.cpp
+++ b/src/filters/source/FLACSource/FLACSource.cpp
@@ -323,7 +323,7 @@ HRESULT CFLACStream::GetMediaType(int iPosition, CMediaType* pmt)
pmt->subtype = MEDIASUBTYPE_FLAC_FRAMED;
pmt->formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)pmt->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->wFormatTag = WAVE_FORMAT_FLAC;
wfe->nChannels = m_nChannels;
wfe->nSamplesPerSec = m_nSamplesPerSec;
diff --git a/src/filters/source/FLICSource/FLICSource.cpp b/src/filters/source/FLICSource/FLICSource.cpp
index 84d8ba9b8..1e2ef22cd 100644
--- a/src/filters/source/FLICSource/FLICSource.cpp
+++ b/src/filters/source/FLICSource/FLICSource.cpp
@@ -265,7 +265,7 @@ CFLICStream::CFLICStream(const WCHAR* wfn, CFLICSource* pParent, HRESULT* phr)
}
m_nLastFrameNum = -1;
- memset(m_pPalette, 0, sizeof(m_pPalette));
+ ZeroMemory(m_pPalette, sizeof(m_pPalette));
m_nBufferSize = m_hdr.width * m_hdr.height * 32 >> 3;
if (!m_pFrameBuffer.Allocate(m_nBufferSize)) {
if (phr) {
@@ -500,7 +500,7 @@ HRESULT CFLICStream::GetMediaType(int iPosition, CMediaType* pmt)
pmt->SetTemporalCompression(TRUE);
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(vih, 0, sizeof(VIDEOINFOHEADER));
+ ZeroMemory(vih, sizeof(VIDEOINFOHEADER));
vih->AvgTimePerFrame = m_AvgTimePerFrame;
vih->bmiHeader.biSize = sizeof(vih->bmiHeader);
vih->bmiHeader.biWidth = m_hdr.width;
@@ -622,7 +622,7 @@ void CFLICStream::ExtractFrame(int nFrame)
void CFLICStream::_blackchunk()
{
- memset(m_pFrameBuffer, 0, m_nBufferSize);
+ ZeroMemory(m_pFrameBuffer, sizeof(m_nBufferSize));
}
void CFLICStream::_copychunk()
diff --git a/src/filters/source/ShoutcastSource/ShoutcastSource.cpp b/src/filters/source/ShoutcastSource/ShoutcastSource.cpp
index 04df8b747..2e06a4281 100644
--- a/src/filters/source/ShoutcastSource/ShoutcastSource.cpp
+++ b/src/filters/source/ShoutcastSource/ShoutcastSource.cpp
@@ -427,7 +427,7 @@ HRESULT CShoutcastStream::GetMediaType(int iPosition, CMediaType* pmt)
pmt->SetFormatType(&FORMAT_WaveFormatEx);
WAVEFORMATEX* wfe = (WAVEFORMATEX*)pmt->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->wFormatTag = (WORD)MEDIASUBTYPE_MP3.Data1;
wfe->nChannels = (WORD)m_socket.m_channels;
wfe->nSamplesPerSec = m_socket.m_freq;
@@ -547,7 +547,8 @@ int CShoutcastStream::CShoutcastSocket::Receive(void* lpBuf, int nBufLen, int nF
m_nBytesRead = 0;
static BYTE buff[255 * 16], b = 0;
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
+
if (1 == __super::Receive(&b, 1) && b && b * 16 == __super::Receive(buff, b * 16)) {
CStringA str = (LPCSTR)buff;
diff --git a/src/filters/source/SubtitleSource/SubtitleSource.cpp b/src/filters/source/SubtitleSource/SubtitleSource.cpp
index e034032d8..2199d3b76 100644
--- a/src/filters/source/SubtitleSource/SubtitleSource.cpp
+++ b/src/filters/source/SubtitleSource/SubtitleSource.cpp
@@ -611,7 +611,7 @@ HRESULT CSubtitleSourceUTF8::GetMediaType(CMediaType* pmt)
pmt->SetSubtype(&MEDIASUBTYPE_UTF8);
pmt->SetFormatType(&FORMAT_SubtitleInfo);
SUBTITLEINFO* psi = (SUBTITLEINFO*)pmt->AllocFormatBuffer(sizeof(SUBTITLEINFO));
- memset(psi, 0, pmt->FormatLength());
+ ZeroMemory(psi, pmt->FormatLength());
strcpy_s(psi->IsoLang, "eng");
return NOERROR;
@@ -657,7 +657,7 @@ HRESULT CSubtitleSourceSSA::GetMediaType(CMediaType* pmt)
f.Seek(3, CFile::begin);
SUBTITLEINFO* psi = (SUBTITLEINFO*)pmt->AllocFormatBuffer(sizeof(SUBTITLEINFO) + len);
- memset(psi, 0, pmt->FormatLength());
+ ZeroMemory(psi, pmt->FormatLength());
psi->dwOffset = sizeof(SUBTITLEINFO);
strcpy_s(psi->IsoLang, "eng");
f.Read(pmt->pbFormat + psi->dwOffset, len);
@@ -707,7 +707,7 @@ HRESULT CSubtitleSourceASS::GetMediaType(CMediaType* pmt)
int len = (int)f.GetLength();
SUBTITLEINFO* psi = (SUBTITLEINFO*)pmt->AllocFormatBuffer(sizeof(SUBTITLEINFO) + len);
- memset(psi, 0, pmt->FormatLength());
+ ZeroMemory(psi, pmt->FormatLength());
psi->dwOffset = sizeof(SUBTITLEINFO);
strcpy_s(psi->IsoLang, "eng");
f.Read(pmt->pbFormat + psi->dwOffset, len);
@@ -736,7 +736,7 @@ HRESULT CSubtitleSourceUSF::GetMediaType(CMediaType* pmt)
pmt->SetSubtype(&MEDIASUBTYPE_USF);
pmt->SetFormatType(&FORMAT_SubtitleInfo);
SUBTITLEINFO* psi = (SUBTITLEINFO*)pmt->AllocFormatBuffer(sizeof(SUBTITLEINFO));
- memset(psi, 0, pmt->FormatLength());
+ ZeroMemory(psi, pmt->FormatLength());
strcpy_s(psi->IsoLang, "eng");
// TODO: ...
@@ -761,7 +761,7 @@ HRESULT CSubtitleSourcePreview::GetMediaType(CMediaType* pmt)
pmt->SetSubtype(&MEDIASUBTYPE_RGB32);
pmt->SetFormatType(&FORMAT_VideoInfo);
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(pvih, 0, pmt->FormatLength());
+ ZeroMemory(pvih, pmt->FormatLength());
pvih->bmiHeader.biSize = sizeof(pvih->bmiHeader);
pvih->bmiHeader.biWidth = _WIDTH;
pvih->bmiHeader.biHeight = _HEIGHT;
@@ -791,7 +791,7 @@ HRESULT CSubtitleSourceARGB::GetMediaType(CMediaType* pmt)
pmt->SetSubtype(&MEDIASUBTYPE_ARGB32);
pmt->SetFormatType(&FORMAT_VideoInfo);
VIDEOINFOHEADER* pvih = (VIDEOINFOHEADER*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(pvih, 0, pmt->FormatLength());
+ ZeroMemory(pvih, pmt->FormatLength());
pvih->bmiHeader.biSize = sizeof(pvih->bmiHeader);
// TODO: read w,h,fps from a config file or registry
pvih->bmiHeader.biWidth = _WIDTH;
diff --git a/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp b/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
index f77bcc8ab..0f9c305ec 100644
--- a/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
+++ b/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
@@ -94,7 +94,7 @@ CAudioSwitcherFilter::CAudioSwitcherFilter(LPUNKNOWN lpunk, HRESULT* phr)
, m_boostFactor(1.0)
, m_normalizeFactor(m_nMaxNormFactor)
{
- memset(m_pSpeakerToChannelMap, 0, sizeof(m_pSpeakerToChannelMap));
+ ZeroMemory(m_pSpeakerToChannelMap, sizeof(m_pSpeakerToChannelMap));
if (phr) {
if (FAILED(*phr)) {
@@ -332,7 +332,7 @@ HRESULT CAudioSwitcherFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
}
}
} else {
- memset(pDataOut, 0, pOut->GetSize());
+ ZeroMemory(pDataOut, pOut->GetSize());
}
} else {
HRESULT hr2;
@@ -346,7 +346,7 @@ HRESULT CAudioSwitcherFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
&& wfe->wBitsPerSample <= 16 && fPCM) {
if (BYTE* buff = DEBUG_NEW BYTE[len * bps]) {
for (int ch = 0; ch < wfeout->nChannels; ch++) {
- memset(buff, 0, len * bps);
+ ZeroMemory(buff, len * bps);
for (int i = 0; i < len; i++) {
memcpy(buff + i * bps, (char*)pDataOut + (ch + i * wfeout->nChannels)*bps, bps);
diff --git a/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp b/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp
index b3424e517..83ca8421a 100644
--- a/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp
+++ b/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp
@@ -427,7 +427,7 @@ HRESULT CAVI2AC3Filter::GetMediaType(int iPosition, CMediaType* pMediaType)
pMediaType->formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)pMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->cbSize = sizeof(WAVEFORMATEX);
wfe->nAvgBytesPerSec = ((WAVEFORMATEX*)m_pInput->CurrentMediaType().pbFormat)->nAvgBytesPerSec;
wfe->nSamplesPerSec = ((WAVEFORMATEX*)m_pInput->CurrentMediaType().pbFormat)->nSamplesPerSec;
@@ -457,7 +457,7 @@ HRESULT CAVI2AC3Filter::GetMediaType(int iPosition, CMediaType* pMediaType)
pMediaType->formattype = FORMAT_WaveFormatEx;
DOLBYAC3WAVEFORMAT* wfe = (DOLBYAC3WAVEFORMAT*)pMediaType->AllocFormatBuffer(sizeof(DOLBYAC3WAVEFORMAT));
- memset(wfe, 0, sizeof(DOLBYAC3WAVEFORMAT));
+ ZeroMemory(wfe, sizeof(DOLBYAC3WAVEFORMAT));
// unfortunately we can't tell what we are going to get in transform,
// so we just set the most common values and hope that the ac3 decoder
// is flexible enough (it is usually :) to find out these from the bitstream
@@ -471,7 +471,7 @@ HRESULT CAVI2AC3Filter::GetMediaType(int iPosition, CMediaType* pMediaType)
pMediaType->formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)pMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- memset(wfe, 0, sizeof(WAVEFORMATEX));
+ ZeroMemory(wfe, sizeof(WAVEFORMATEX));
// same case as with ac3, but this time we don't even know the structure
wfe->cbSize = sizeof(WAVEFORMATEX);
wfe->wFormatTag = WAVE_FORMAT_PCM;
diff --git a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
index ee87da93b..4b1c58a03 100644
--- a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
+++ b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
@@ -326,7 +326,7 @@ HRESULT CBaseVideoFilter::CopyBuffer(BYTE* pOut, BYTE** ppIn, int w, int h, int
} else if (bihOut.biCompression == BI_RGB || bihOut.biCompression == BI_BITFIELDS) {
if (!BitBltFromI420ToRGB(w, h, pOut, pitchOut, bihOut.biBitCount, pIn, pInU, pInV, pitchIn)) {
for (int y = 0; y < h; y++, pOut += pitchOut) {
- memset(pOut, 0, pitchOut);
+ ZeroMemory(pOut, pitchOut);
}
}
}
@@ -336,7 +336,7 @@ HRESULT CBaseVideoFilter::CopyBuffer(BYTE* pOut, BYTE** ppIn, int w, int h, int
} else if (bihOut.biCompression == BI_RGB || bihOut.biCompression == BI_BITFIELDS) {
if (!BitBltFromYUY2ToRGB(w, h, pOut, pitchOut, bihOut.biBitCount, ppIn[0], pitchIn)) {
for (int y = 0; y < h; y++, pOut += pitchOut) {
- memset(pOut, 0, pitchOut);
+ ZeroMemory(pOut, pitchOut);
}
}
}
@@ -352,7 +352,7 @@ HRESULT CBaseVideoFilter::CopyBuffer(BYTE* pOut, BYTE** ppIn, int w, int h, int
} else if (bihOut.biCompression == BI_RGB || bihOut.biCompression == BI_BITFIELDS) {
if (!BitBltFromRGBToRGB(w, h, pOut, pitchOut, bihOut.biBitCount, ppIn[0], pitchIn, sbpp)) {
for (int y = 0; y < h; y++, pOut += pitchOut) {
- memset(pOut, 0, pitchOut);
+ ZeroMemory(pOut, pitchOut);
}
}
}
@@ -533,7 +533,7 @@ HRESULT CBaseVideoFilter::GetMediaType(int iPosition, CMediaType* pmt)
GetOutputSize(w, h, arx, ary, RealWidth, RealHeight, vsfilter);
BITMAPINFOHEADER bihOut;
- memset(&bihOut, 0, sizeof(bihOut));
+ ZeroMemory(&bihOut, sizeof(bihOut));
bihOut.biSize = sizeof(bihOut);
bihOut.biWidth = w;
bihOut.biHeight = h;
@@ -545,14 +545,14 @@ HRESULT CBaseVideoFilter::GetMediaType(int iPosition, CMediaType* pmt)
if (iPosition & 1) {
pmt->formattype = FORMAT_VideoInfo;
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(vih, 0, sizeof(VIDEOINFOHEADER));
+ ZeroMemory(vih, sizeof(VIDEOINFOHEADER));
vih->bmiHeader = bihOut;
vih->bmiHeader.biXPelsPerMeter = vih->bmiHeader.biWidth * ary;
vih->bmiHeader.biYPelsPerMeter = vih->bmiHeader.biHeight * arx;
} else {
pmt->formattype = FORMAT_VideoInfo2;
VIDEOINFOHEADER2* vih = (VIDEOINFOHEADER2*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER2));
- memset(vih, 0, sizeof(VIDEOINFOHEADER2));
+ ZeroMemory(vih, sizeof(VIDEOINFOHEADER2));
vih->bmiHeader = bihOut;
vih->dwPictAspectRatioX = arx;
vih->dwPictAspectRatioY = ary;
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp
index 4265075d2..dda150c79 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp
@@ -83,15 +83,15 @@ void CDXVADecoder::Init(CMPCVideoDecFilter* pFilter, DXVAMode nMode, int nPicEnt
m_dwNumBuffersInfo = 0;
m_bNeedChangeAspect = true;
- memset(&m_DXVA1Config, 0, sizeof(m_DXVA1Config));
- memset(&m_DXVA1BufferDesc, 0, sizeof(m_DXVA1BufferDesc));
+ ZeroMemory(&m_DXVA1Config, sizeof(m_DXVA1Config));
+ ZeroMemory(&m_DXVA1BufferDesc, sizeof(m_DXVA1BufferDesc));
m_DXVA1Config.guidConfigBitstreamEncryption = DXVA_NoEncrypt;
m_DXVA1Config.guidConfigMBcontrolEncryption = DXVA_NoEncrypt;
m_DXVA1Config.guidConfigResidDiffEncryption = DXVA_NoEncrypt;
m_DXVA1Config.bConfigBitstreamRaw = 2;
- memset(&m_DXVA1BufferInfo, 0, sizeof(m_DXVA1BufferInfo));
- memset(&m_ExecuteParams, 0, sizeof(m_ExecuteParams));
+ ZeroMemory(&m_DXVA1BufferInfo, sizeof(m_DXVA1BufferInfo));
+ ZeroMemory(&m_ExecuteParams, sizeof(m_ExecuteParams));
Flush();
}
@@ -101,7 +101,7 @@ void CDXVADecoder::AllocExecuteParams(int nSize)
m_ExecuteParams.pCompressedBuffers = DEBUG_NEW DXVA2_DecodeBufferDesc[nSize];
for (int i = 0; i < nSize; i++) {
- memset(&m_ExecuteParams.pCompressedBuffers[i], 0, sizeof(DXVA2_DecodeBufferDesc));
+ ZeroMemory(&m_ExecuteParams.pCompressedBuffers[i], sizeof(DXVA2_DecodeBufferDesc));
}
}
@@ -142,7 +142,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1()
DXVA_ConfigPictureDecode ConfigRequested;
if (m_pAMVideoAccelerator) {
- memset(&ConfigRequested, 0, sizeof(ConfigRequested));
+ ZeroMemory(&ConfigRequested, sizeof(ConfigRequested));
ConfigRequested.guidConfigBitstreamEncryption = DXVA_NoEncrypt;
ConfigRequested.guidConfigMBcontrolEncryption = DXVA_NoEncrypt;
ConfigRequested.guidConfigResidDiffEncryption = DXVA_NoEncrypt;
@@ -367,8 +367,8 @@ HRESULT CDXVADecoder::QueryStatus(PVOID LPDXVAStatus, UINT nSize)
break;
case ENGINE_DXVA2:
- memset(&ExecuteParams, 0, sizeof(ExecuteParams));
- memset(&ExtensionData, 0, sizeof(ExtensionData));
+ ZeroMemory(&ExecuteParams, sizeof(ExecuteParams));
+ ZeroMemory(&ExtensionData, sizeof(ExtensionData));
ExecuteParams.pExtensionData = &ExtensionData;
ExtensionData.pPrivateOutputData = LPDXVAStatus;
ExtensionData.PrivateOutputDataSize = nSize;
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp
index 71ffbe82a..3c46e62e8 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp
@@ -53,10 +53,10 @@ CDXVADecoderH264::~CDXVADecoderH264()
void CDXVADecoderH264::Init()
{
- memset(&m_DXVAPicParams, 0, sizeof(m_DXVAPicParams));
- memset(&m_DXVAPicParams, 0, sizeof(DXVA_PicParams_H264));
- memset(&m_pSliceLong, 0, sizeof(DXVA_Slice_H264_Long) * MAX_SLICES);
- memset(&m_pSliceShort, 0, sizeof(DXVA_Slice_H264_Short) * MAX_SLICES);
+ ZeroMemory(&m_DXVAPicParams, sizeof(m_DXVAPicParams));
+ ZeroMemory(&m_DXVAPicParams, sizeof(DXVA_PicParams_H264));
+ ZeroMemory(&m_pSliceLong, sizeof(DXVA_Slice_H264_Long) * MAX_SLICES);
+ ZeroMemory(&m_pSliceShort, sizeof(DXVA_Slice_H264_Short) * MAX_SLICES);
m_DXVAPicParams.MbsConsecutiveFlag = 1;
if (m_pFilter->GetPCIVendor() == PCIV_Intel) {
@@ -137,7 +137,7 @@ void CDXVADecoderH264::CopyBitstream(BYTE* pDXVABuffer, BYTE* pBuffer, UINT& nSi
// Complete with zero padding (buffer size should be a multiple of 128)
nDummy = 128 - (nSize % 128);
- memset(pDXVABuffer, 0, nDummy);
+ ZeroMemory(pDXVABuffer, nDummy);
m_pSliceShort[nSlices - 1].SliceBytesInBuffer += nDummy;
nSize += nDummy;
}
@@ -354,7 +354,7 @@ HRESULT CDXVADecoderH264::DisplayStatus()
HRESULT hr = E_INVALIDARG;
DXVA_Status_H264 Status;
- memset(&Status, 0, sizeof(Status));
+ ZeroMemory(&Status, sizeof(Status));
CHECK_HR_TRACE(CDXVADecoder::QueryStatus(&Status, sizeof(Status)));
TRACE_H264("CDXVADecoderH264::DisplayStatus() : Status for the frame %u : bBufType = %u, bStatus = %u, wNumMbsAffected = %u\n",
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp
index 286ba9d0c..a6e7d8dd5 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp
@@ -49,9 +49,9 @@ CDXVADecoderMpeg2::~CDXVADecoderMpeg2()
void CDXVADecoderMpeg2::Init()
{
- memset(&m_PictureParams, 0, sizeof(m_PictureParams));
- memset(&m_SliceInfo, 0, sizeof(m_SliceInfo));
- memset(&m_QMatrixData, 0, sizeof(m_QMatrixData));
+ ZeroMemory(&m_PictureParams, sizeof(m_PictureParams));
+ ZeroMemory(&m_SliceInfo, sizeof(m_SliceInfo));
+ ZeroMemory(&m_QMatrixData, sizeof(m_QMatrixData));
m_nMaxWaiting = 5;
m_wRefPictureIndex[0] = NO_REF_FRAME;
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
index 66910d6c4..acdd62520 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
@@ -57,8 +57,8 @@ CDXVADecoderVC1::~CDXVADecoderVC1()
void CDXVADecoderVC1::Init()
{
- memset(&m_PictureParams, 0, sizeof(m_PictureParams));
- memset(&m_SliceInfo, 0, sizeof(m_SliceInfo));
+ ZeroMemory(&m_PictureParams, sizeof(m_PictureParams));
+ ZeroMemory(&m_SliceInfo, sizeof(m_SliceInfo));
m_nMaxWaiting = 5;
m_wRefPictureIndex[0] = NO_REF_FRAME;
@@ -286,7 +286,7 @@ void CDXVADecoderVC1::CopyBitstream(BYTE* pDXVABuffer, BYTE* pBuffer, UINT& nSiz
// Copy bitstream buffer, with zero padding (buffer is rounded to multiple of 128)
nDummy = 128 - (nSize % 128);
- memset(pDXVABuffer + nSize, 0, nDummy);
+ ZeroMemory(pDXVABuffer + nSize, nDummy);
nSize += nDummy;
}
@@ -314,7 +314,7 @@ HRESULT CDXVADecoderVC1::DisplayStatus()
HRESULT hr = E_INVALIDARG;
DXVA_Status_VC1 Status;
- memset(&Status, 0, sizeof(Status));
+ ZeroMemory(&Status, sizeof(Status));
if (SUCCEEDED(hr = CDXVADecoder::QueryStatus(&Status, sizeof(Status)))) {
Status.StatusReportFeedbackNumber = 0x00FF & Status.StatusReportFeedbackNumber;
diff --git a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp
index c5d496228..06a9ea3fe 100644
--- a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp
+++ b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp
@@ -294,7 +294,7 @@ int FFH264CheckCompatibility(int nWidth,
void CopyScalingMatrix(DXVA_Qmatrix_H264* pDest, PPS* pps, DWORD nPCIVendor)
{
int i, j;
- memset(pDest, 0, sizeof(DXVA_Qmatrix_H264));
+ ZeroMemory(pDest, sizeof(DXVA_Qmatrix_H264));
if (nPCIVendor == PCIV_ATI) {
for (i = 0; i < 6; i++) {
for (j = 0; j < 16; j++) {
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
index 18fea379a..e49553dc7 100644
--- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
+++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
@@ -1503,7 +1503,7 @@ HRESULT CMPCVideoDecFilter::NewSegment(REFERENCE_TIME rtStart, REFERENCE_TIME rt
}
m_nPosB = 1;
- memset(&m_BFrames, 0, sizeof(m_BFrames));
+ ZeroMemory(&m_BFrames, sizeof(m_BFrames));
m_rtLastStart = 0;
m_nCountEstimated = 0;
m_dRate = dRate;
@@ -1751,7 +1751,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int
// Note: If the first 23 bits of the additional bytes are not 0, then damaged
// MPEG bitstreams could cause overread and segfault.
memcpy(m_pFFBuffer, pDataIn, nSize);
- memset(m_pFFBuffer + nSize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ ZeroMemory(m_pFFBuffer + nSize, FF_INPUT_BUFFER_PADDING_SIZE);
avpkt.data = m_pFFBuffer;
avpkt.size = nSize;
@@ -2113,7 +2113,7 @@ void CMPCVideoDecFilter::ReorderBFrames(REFERENCE_TIME& rtStart, REFERENCE_TIME&
void CMPCVideoDecFilter::FillInVideoDescription(DXVA2_VideoDesc* pDesc)
{
- memset(pDesc, 0, sizeof(DXVA2_VideoDesc));
+ ZeroMemory(pDesc, sizeof(DXVA2_VideoDesc));
pDesc->SampleWidth = PictWidthRounded();
pDesc->SampleHeight = PictHeightRounded();
pDesc->Format = D3DFMT_A8R8G8B8;
diff --git a/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp b/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp
index 9f38a7852..a0b9e1c8e 100644
--- a/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp
+++ b/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp
@@ -31,7 +31,7 @@ CVideoDecOutputPin::CVideoDecOutputPin(TCHAR* pObjectName, CBaseVideoFilter* pFi
m_pDXVA2Allocator = nullptr;
m_dwDXVA1SurfaceCount = 0;
m_GuidDecoderDXVA1 = GUID_NULL;
- memset(&m_ddUncompPixelFormat, 0, sizeof(m_ddUncompPixelFormat));
+ ZeroMemory(&m_ddUncompPixelFormat, sizeof(m_ddUncompPixelFormat));
}
CVideoDecOutputPin::~CVideoDecOutputPin()
diff --git a/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp b/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
index 25fe1fc75..16d534219 100644
--- a/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
+++ b/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
@@ -174,7 +174,7 @@ CFFAudioDecoder::CFFAudioDecoder()
, m_pParser(nullptr)
, m_pFrame(nullptr)
{
- memset(&m_raData, 0, sizeof(m_raData));
+ ZeroMemory(&m_raData, sizeof(m_raData));
}
bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput)
@@ -237,7 +237,7 @@ bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput)
unsigned extralen = 0;
getExtraData((BYTE*)format, &format_type, formatlen, nullptr, &extralen);
- memset(&m_raData, 0, sizeof(m_raData));
+ ZeroMemory(&m_raData, sizeof(m_raData));
if (extralen) {
if (nCodecId == AV_CODEC_ID_COOK || nCodecId == AV_CODEC_ID_ATRAC3 || nCodecId == AV_CODEC_ID_SIPR) {
diff --git a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
index f68c1cdba..9167e19c5 100644
--- a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
+++ b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
@@ -1045,7 +1045,7 @@ HRESULT CMpaDecFilter::ProcessTrueHD_SPDIF()
if (m_hdmisize + size <= m_hdmicount * BS_MAT_OFFSET) {
memcpy(m_hdmibuff + m_hdmisize, p, size);
m_hdmisize += size;
- memset(m_hdmibuff + m_hdmisize, 0, m_hdmicount * BS_MAT_OFFSET - m_hdmisize);
+ ZeroMemory(m_hdmibuff + m_hdmisize, m_hdmicount * BS_MAT_OFFSET - m_hdmisize);
m_hdmisize = m_hdmicount * BS_MAT_OFFSET;
} else {
ASSERT(0);
@@ -1381,7 +1381,7 @@ HRESULT CMpaDecFilter::ProcessPS2PCM()
if (m_ps2_state.sync) {
memcpy(outBuff.GetData(), p, size);
} else {
- memset(outBuff.GetData(), 0, size);
+ ZeroMemory(outBuff.GetData(), size);
}
HRESULT hr;
@@ -1465,7 +1465,7 @@ HRESULT CMpaDecFilter::ProcessPS2ADPCM()
}
}
} else {
- memset(outBuff.GetData(), 0, outSize);
+ ZeroMemory(outBuff.GetData(), outSize);
}
HRESULT hr;
@@ -1682,7 +1682,7 @@ HRESULT CMpaDecFilter::DeliverBitstream(BYTE* pBuff, int size, WORD type, int sa
if (isDTSWAV) {
memcpy(pDataOut, pBuff, size);
} else {
- memset(pDataOut + BS_HEADER_SIZE + size, 0, length - (BS_HEADER_SIZE + size)); // Fill after the input buffer with zeros if any extra bytes
+ ZeroMemory(pDataOut + BS_HEADER_SIZE + size, length - (BS_HEADER_SIZE + size)); // Fill after the input buffer with zeros if any extra bytes
int index = 0;
// Fill the 8 bytes (4 words) of IEC header
@@ -1795,7 +1795,7 @@ CMediaType CMpaDecFilter::CreateMediaType(MPCSampleFormat sf, DWORD nSamplesPerS
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEXTENSIBLE wfex;
- //memset(&wfex, 0, sizeof(wfex));
+ //ZeroMemory(&wfex, sizeof(wfex));
WAVEFORMATEX& wfe = wfex.Format;
wfe.nChannels = nChannels;
@@ -1862,7 +1862,7 @@ CMediaType CMpaDecFilter::CreateMediaTypeHDMI(WORD type)
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEXTENSIBLE wfex;
- memset(&wfex, 0, sizeof(wfex));
+ ZeroMemory(&wfex, sizeof(wfex));
GUID subtype = GUID_NULL;
diff --git a/src/filters/transform/MpaDecFilter/PaddedArray.h b/src/filters/transform/MpaDecFilter/PaddedArray.h
index b4a164d2c..2cf2257e0 100644
--- a/src/filters/transform/MpaDecFilter/PaddedArray.h
+++ b/src/filters/transform/MpaDecFilter/PaddedArray.h
@@ -1,5 +1,5 @@
/*
- * (C) 2012 see Authors.txt
+ * (C) 2012-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -39,7 +39,7 @@ public:
bool SetCount(size_t nNewSize, int nGrowBy = - 1) {
if (__super::SetCount(nNewSize + m_padsize, nGrowBy)) {
- memset(GetData() + nNewSize, 0, m_padsize);
+ ZeroMemory(GetData() + nNewSize, m_padsize);
return true;
}
return false;
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h
index a676f4fbb..aa48e2ab8 100644
--- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h
+++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h
@@ -65,7 +65,7 @@ class __declspec(uuid("39F498AF-1A09-4275-B193-673B0BA3D478"))
: di(DIAuto) {
w = h = pitch = 0;
buf_base = nullptr;
- memset(&buf, 0, sizeof(buf));
+ ZeroMemory(&buf, sizeof(buf));
rtStart = rtStop = 0;
flags = 0;
}
@@ -246,7 +246,7 @@ class CSubpicInputPin : public CMpeg2DecInputPin
AM_PROPERTY_SPHLI m_sphli; // parsed
CAutoPtr<AM_PROPERTY_SPHLI> m_psphli; // for the menu (optional)
spu() {
- memset(&m_sphli, 0, sizeof(m_sphli));
+ ZeroMemory(&m_sphli, sizeof(m_sphli));
m_fForced = false;
m_rtStart = m_rtStop = 0;
}
@@ -272,7 +272,7 @@ class CSubpicInputPin : public CMpeg2DecInputPin
public:
AM_DVD_YUV m_sppal[2][4];
cvdspu() {
- memset(m_sppal, 0, sizeof(m_sppal));
+ ZeroMemory(m_sppal, sizeof(m_sppal));
}
bool Parse();
void Render(REFERENCE_TIME rt, BYTE** p, int w, int h, AM_DVD_YUV* sppal, bool fsppal);
@@ -283,7 +283,7 @@ class CSubpicInputPin : public CMpeg2DecInputPin
public:
AM_DVD_YUV m_sppal[4];
svcdspu() {
- memset(m_sppal, 0, sizeof(m_sppal));
+ ZeroMemory(m_sppal, sizeof(m_sppal));
}
bool Parse();
void Render(REFERENCE_TIME rt, BYTE** p, int w, int h, AM_DVD_YUV* sppal, bool fsppal);
diff --git a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp
index f7161f340..c77e7cf66 100644
--- a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp
+++ b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp
@@ -59,7 +59,7 @@ CDirectVobSubFilter::CDirectVobSubFilter(LPUNKNOWN punk, HRESULT* phr, const GUI
{
LOGFONT lf;
- memset(&lf, 0, sizeof(lf));
+ ZeroMemory(&lf, sizeof(lf));
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfOutPrecision = OUT_CHARACTER_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
@@ -93,7 +93,7 @@ CDirectVobSubFilter::CDirectVobSubFilter(LPUNKNOWN punk, HRESULT* phr, const GUI
m_frd.EndThreadEvent.Create(0, FALSE, FALSE, 0);
m_frd.RefreshEvent.Create(0, FALSE, FALSE, 0);
- memset(&m_CurrentVIH2, 0, sizeof(VIDEOINFOHEADER2));
+ ZeroMemory(&m_CurrentVIH2, sizeof(VIDEOINFOHEADER2));
}
CDirectVobSubFilter::~CDirectVobSubFilter()
@@ -1242,7 +1242,7 @@ HRESULT CDirectVobSubFilter2::JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pNam
cmt.bTemporalCompression = TRUE;
cmt.lSampleSize = 384 * 288 * 2;
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)cmt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- memset(vih, 0, sizeof(VIDEOINFOHEADER));
+ ZeroMemory(vih, sizeof(VIDEOINFOHEADER));
memcpy(&vih->bmiHeader, &bih, sizeof(bih));
vih->AvgTimePerFrame = 400000;
@@ -1252,7 +1252,7 @@ HRESULT CDirectVobSubFilter2::JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pNam
}
VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)cmt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER2));
- memset(vih2, 0, sizeof(VIDEOINFOHEADER2));
+ ZeroMemory(vih2, sizeof(VIDEOINFOHEADER2));
memcpy(&vih2->bmiHeader, &bih, sizeof(bih));
vih2->AvgTimePerFrame = 400000;
vih2->dwPictAspectRatioX = 384;
diff --git a/src/mpc-hc/AppSettings.cpp b/src/mpc-hc/AppSettings.cpp
index bd9cfe66f..6bb52e901 100644
--- a/src/mpc-hc/AppSettings.cpp
+++ b/src/mpc-hc/AppSettings.cpp
@@ -1159,7 +1159,7 @@ void CAppSettings::LoadSettings()
if (bResult && len == sizeof(pSpeakerToChannelMap)) {
memcpy(pSpeakerToChannelMap, ptr, sizeof(pSpeakerToChannelMap));
} else {
- memset(pSpeakerToChannelMap, 0, sizeof(pSpeakerToChannelMap));
+ ZeroMemory(pSpeakerToChannelMap, sizeof(pSpeakerToChannelMap));
for (int j = 0; j < 18; j++) {
for (int i = 0; i <= j; i++) {
pSpeakerToChannelMap[j][i] = 1 << i;
@@ -1732,7 +1732,7 @@ void CAppSettings::ParseCommandLine(CAtlList<CString>& cmdln)
rtShift = 0;
lDVDTitle = 0;
lDVDChapter = 0;
- memset(&DVDPosition, 0, sizeof(DVDPosition));
+ ZeroMemory(&DVDPosition, sizeof(DVDPosition));
iAdminOption = 0;
sizeFixedWindow.SetSize(0, 0);
iMonitor = 0;
diff --git a/src/mpc-hc/FGManager.cpp b/src/mpc-hc/FGManager.cpp
index 796c58714..33f90af38 100644
--- a/src/mpc-hc/FGManager.cpp
+++ b/src/mpc-hc/FGManager.cpp
@@ -379,7 +379,7 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl
CRegKey key;
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Media Type\\Extensions\\") + CString(ext), KEY_READ)) {
ULONG len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
LONG ret = key.QueryStringValue(_T("Source Filter"), buff, &len); // QueryStringValue can return ERROR_INVALID_DATA on bogus strings (radlight mpc v1003, fixed in v1004)
if (ERROR_SUCCESS == ret || ERROR_INVALID_DATA == ret && GUIDFromCString(buff) != GUID_NULL) {
GUID clsid = GUIDFromCString(buff);
@@ -2394,7 +2394,7 @@ CFGManagerCustom::CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk)
TCHAR buff[256];
ULONG len = sizeof(buff);
- memset(buff, 0, len);
+ ZeroMemory(buff, sizeof(buff));
CString clsid = _T("{B38C58A0-1809-11D6-A458-EDAE78F1DF12}");
diff --git a/src/mpc-hc/FileAssoc.cpp b/src/mpc-hc/FileAssoc.cpp
index 315bd7ac7..1c8963130 100644
--- a/src/mpc-hc/FileAssoc.cpp
+++ b/src/mpc-hc/FileAssoc.cpp
@@ -294,7 +294,7 @@ bool CFileAssoc::SetFileAssociation(CString strExt, CString strProgID, bool bReg
HRESULT hr = S_OK;
TCHAR buff[MAX_PATH];
ULONG len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (!m_pAAR) {
m_pAAR = CFileAssoc::CreateRegistrationManager();
@@ -324,7 +324,7 @@ bool CFileAssoc::SetFileAssociation(CString strExt, CString strProgID, bool bReg
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, CString(pszCurrentAssociation) + _T("\\DefaultIcon")))
{
len = sizeof(buff);
- memset(buff, 0, len);
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && !CString(buff).Trim().IsEmpty())
{
if (ERROR_SUCCESS == key.Create(HKEY_CLASSES_ROOT, strProgID + _T("\\DefaultIcon")))
@@ -357,7 +357,7 @@ bool CFileAssoc::SetFileAssociation(CString strExt, CString strProgID, bool bReg
}
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && !CString(buff).Trim().IsEmpty()) {
extOldReg = buff;
}
@@ -372,7 +372,7 @@ bool CFileAssoc::SetFileAssociation(CString strExt, CString strProgID, bool bReg
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, extoldreg + _T("\\DefaultIcon")))
{
len = sizeof(buff);
- memset(buff, 0, len);
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && !CString(buff).Trim().IsEmpty())
extOldIcon = buff;
}
@@ -392,7 +392,7 @@ bool CFileAssoc::SetFileAssociation(CString strExt, CString strProgID, bool bReg
} else {
// Get previous association
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS != key.Create(HKEY_CLASSES_ROOT, strProgID)) {
return false;
}
@@ -431,7 +431,7 @@ bool CFileAssoc::IsRegistered(CString ext)
CRegKey key;
TCHAR buff[MAX_PATH];
ULONG len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS != key.Open(HKEY_CLASSES_ROOT, ext, KEY_READ)
|| ERROR_SUCCESS != key.QueryStringValue(nullptr, buff, &len)
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp
index 7ef4015ee..18f321330 100644
--- a/src/mpc-hc/MainFrm.cpp
+++ b/src/mpc-hc/MainFrm.cpp
@@ -1159,7 +1159,7 @@ void CMainFrame::RecalcLayout(BOOL bNotify)
CRect r;
GetWindowRect(&r);
MINMAXINFO mmi;
- memset(&mmi, 0, sizeof(mmi));
+ ZeroMemory(&mmi, sizeof(mmi));
SendMessage(WM_GETMINMAXINFO, 0, (LPARAM)&mmi);
r |= CRect(r.TopLeft(), CSize(r.Width(), mmi.ptMinTrackSize.y));
MoveWindow(&r);
@@ -1226,7 +1226,7 @@ void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
if (!IsMenuHidden()) {
MENUBARINFO mbi;
- memset(&mbi, 0, sizeof(mbi));
+ ZeroMemory(&mbi, sizeof(mbi));
mbi.cbSize = sizeof(mbi);
::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi);
@@ -1378,7 +1378,7 @@ void CMainFrame::OnSizing(UINT fwSide, LPRECT pRect)
// This doesn't give correct menu pixel size
//MENUBARINFO mbi;
- //memset(&mbi, 0, sizeof(mbi));
+ //ZeroMemory(&mbi, sizeof(mbi));
//mbi.cbSize = sizeof(mbi);
//::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi);
@@ -1480,8 +1480,10 @@ void CMainFrame::OnDisplayChange() // untested, not sure if it's working...
if (IsD3DFullScreenMode()) {
MONITORINFO MonitorInfo;
HMONITOR hMonitor;
+
ZeroMemory(&MonitorInfo, sizeof(MonitorInfo));
MonitorInfo.cbSize = sizeof(MonitorInfo);
+
hMonitor = MonitorFromWindow(m_pFullscreenWnd->m_hWnd, 0);
if (GetMonitorInfo(hMonitor, &MonitorInfo)) {
CRect MonitorRect = CRect(MonitorInfo.rcMonitor);
@@ -4852,7 +4854,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn)
}
BITMAPINFOHEADER* bih = (BITMAPINFOHEADER*)(BYTE*)dib;
- memset(bih, 0, sizeof(BITMAPINFOHEADER));
+ ZeroMemory(bih, sizeof(BITMAPINFOHEADER));
bih->biSize = sizeof(BITMAPINFOHEADER);
bih->biWidth = width;
bih->biHeight = height;
@@ -11479,7 +11481,7 @@ void CMainFrame::OpenSetupStatusBar()
if (S_OK == m_pGB->IsPinDirection(pPin, PINDIR_INPUT)
&& S_OK == m_pGB->IsPinConnected(pPin)) {
AM_MEDIA_TYPE mt;
- memset(&mt, 0, sizeof(mt));
+ ZeroMemory(&mt, sizeof(mt));
pPin->ConnectionMediaType(&mt);
if (mt.majortype == MEDIATYPE_Audio && mt.formattype == FORMAT_WaveFormatEx) {
diff --git a/src/mpc-hc/Mpeg2SectionData.cpp b/src/mpc-hc/Mpeg2SectionData.cpp
index 5ea16aec5..72aab283c 100644
--- a/src/mpc-hc/Mpeg2SectionData.cpp
+++ b/src/mpc-hc/Mpeg2SectionData.cpp
@@ -47,7 +47,7 @@ CMpeg2DataParser::CMpeg2DataParser(IBaseFilter* pFilter)
{
m_pData = pFilter;
- memset(&m_Filter, 0, sizeof(m_Filter));
+ ZeroMemory(&m_Filter, sizeof(m_Filter));
m_Filter.bVersionNumber = 1;
m_Filter.wFilterSize = MPEG2_FILTER_VERSION_1_SIZE;
m_Filter.fSpecifySectionNumber = TRUE;
diff --git a/src/mpc-hc/PPageFileMediaInfo.cpp b/src/mpc-hc/PPageFileMediaInfo.cpp
index 2dd217651..e11c1daec 100644
--- a/src/mpc-hc/PPageFileMediaInfo.cpp
+++ b/src/mpc-hc/PPageFileMediaInfo.cpp
@@ -126,7 +126,7 @@ BOOL CPPageFileMediaInfo::OnInitDialog()
}
LOGFONT lf;
- memset(&lf, 0, sizeof(lf));
+ ZeroMemory(&lf, sizeof(lf));
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_MODERN;
// The empty string will fallback to the first font that matches the other specified attributes.
LPCTSTR fonts[] = { _T("Lucida Console"), _T("Courier New"), _T("") };
diff --git a/src/mpc-hc/PlayerCaptureDialog.cpp b/src/mpc-hc/PlayerCaptureDialog.cpp
index e0c374f8f..b092d286a 100644
--- a/src/mpc-hc/PlayerCaptureDialog.cpp
+++ b/src/mpc-hc/PlayerCaptureDialog.cpp
@@ -43,7 +43,7 @@ static bool LoadMediaType(CStringW DisplayName, AM_MEDIA_TYPE** ppmt)
return fRet;
}
- memset(*ppmt, 0, sizeof(AM_MEDIA_TYPE));
+ ZeroMemory(*ppmt, sizeof(AM_MEDIA_TYPE));
BYTE* pData;
UINT len;
@@ -142,7 +142,7 @@ static void SaveDefaultCodec(CAtlArray<Codec>& codecs, const CComboBox& box, con
static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, VIDEO_STREAM_CONFIG_CAPS& caps)
{
- memset(&caps, 0, sizeof(caps));
+ ZeroMemory(&caps, sizeof(caps));
if (!pmt) {
return;
@@ -180,7 +180,7 @@ static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, VIDEO_STREAM_CONFIG_CAPS& caps)
static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, AUDIO_STREAM_CONFIG_CAPS& caps)
{
- memset(&caps, 0, sizeof(caps));
+ ZeroMemory(&caps, sizeof(caps));
if (!pmt) {
return;
diff --git a/src/mpc-hc/PlayerCaptureDialog.h b/src/mpc-hc/PlayerCaptureDialog.h
index 38db649a1..a51ee5fdf 100644
--- a/src/mpc-hc/PlayerCaptureDialog.h
+++ b/src/mpc-hc/PlayerCaptureDialog.h
@@ -178,7 +178,7 @@ public:
// it may have a fourcc in the mediasubtype, let's check that
WCHAR guid[100];
- memset(guid, 0, 100 * sizeof(WCHAR));
+ ZeroMemory(guid, 100 * sizeof(WCHAR));
StringFromGUID2(pmt->subtype, guid, 100);
if (CStringW(guid).MakeUpper().Find(L"0000-0010-8000-00AA00389B71") >= 0) {
@@ -272,7 +272,7 @@ public:
if (!wfe) {
WCHAR guid[100];
- memset(guid, 0, 100 * sizeof(WCHAR));
+ ZeroMemory(guid, 100 * sizeof(WCHAR));
StringFromGUID2(pmt->subtype, guid, 100);
if (CStringW(guid).MakeUpper().Find(L"0000-0010-8000-00AA00389B71") >= 0) {
diff --git a/src/mpc-hc/PlayerSeekBar.cpp b/src/mpc-hc/PlayerSeekBar.cpp
index 3812ff671..a0628c3c1 100644
--- a/src/mpc-hc/PlayerSeekBar.cpp
+++ b/src/mpc-hc/PlayerSeekBar.cpp
@@ -65,7 +65,7 @@ BOOL CPlayerSeekBar::Create(CWnd* pParentWnd)
m_tooltip.SetDelayTime(TTDT_INITIAL, 0);
m_tooltip.SetDelayTime(TTDT_RESHOW, 0);
- memset(&m_ti, 0, sizeof(TOOLINFO));
+ ZeroMemory(&m_ti, sizeof(TOOLINFO));
m_ti.cbSize = sizeof(TOOLINFO);
m_ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
m_ti.hwnd = m_hWnd;
diff --git a/src/mpc-hc/PlayerStatusBar.cpp b/src/mpc-hc/PlayerStatusBar.cpp
index c7033b31d..dbb704339 100644
--- a/src/mpc-hc/PlayerStatusBar.cpp
+++ b/src/mpc-hc/PlayerStatusBar.cpp
@@ -101,7 +101,7 @@ int CPlayerStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
void CPlayerStatusBar::Relayout()
{
BITMAP bm;
- memset(&bm, 0, sizeof(bm));
+ ZeroMemory(&bm, sizeof(bm));
if (m_bm.m_hObject) {
m_bm.GetBitmap(&bm);
}
diff --git a/src/mpc-hc/QuicktimeGraph.cpp b/src/mpc-hc/QuicktimeGraph.cpp
index 442e56bee..d7bbe3977 100644
--- a/src/mpc-hc/QuicktimeGraph.cpp
+++ b/src/mpc-hc/QuicktimeGraph.cpp
@@ -531,7 +531,7 @@ bool CQuicktimeWindow::OpenMovie(CString fn)
long bmiColors[256];
} bmi;
- memset(&bmi, 0, sizeof(bmi));
+ ZeroMemory(&bmi, sizeof(bmi));
//int bpp = m_dc.GetDeviceCaps(BITSPIXEL);
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/src/mpc-hc/RealMediaGraph.cpp b/src/mpc-hc/RealMediaGraph.cpp
index 1eafd8b81..39d93db63 100644
--- a/src/mpc-hc/RealMediaGraph.cpp
+++ b/src/mpc-hc/RealMediaGraph.cpp
@@ -629,7 +629,7 @@ STDMETHODIMP CRealMediaPlayerWindowless::SizeChanged(PNxSize* size)
{
if (CComQIPtr<IRMAVideoSurface, &IID_IRMAVideoSurface> pRMAVS = m_pRMAP) {
RMABitmapInfoHeader BitmapInfo;
- memset(&BitmapInfo, 0, sizeof(BitmapInfo));
+ ZeroMemory(&BitmapInfo, sizeof(BitmapInfo));
BitmapInfo.biWidth = size->cx;
BitmapInfo.biHeight = size->cy;
pRMAVS->BeginOptimizedBlt(&BitmapInfo);
diff --git a/src/mpc-hc/RealMediaWindowlessSite.cpp b/src/mpc-hc/RealMediaWindowlessSite.cpp
index 6c321a8f1..89a332796 100644
--- a/src/mpc-hc/RealMediaWindowlessSite.cpp
+++ b/src/mpc-hc/RealMediaWindowlessSite.cpp
@@ -130,7 +130,7 @@ CRealMediaWindowlessSite::CRealMediaWindowlessSite(HRESULT& hr, IUnknown* pConte
m_size.cx = m_size.cy = 0;
m_position.x = m_position.y = 0;
- memset(&m_lastBitmapInfo, 0, sizeof(m_lastBitmapInfo));
+ ZeroMemory(&m_lastBitmapInfo, sizeof(m_lastBitmapInfo));
hr = S_OK;
@@ -267,7 +267,7 @@ void CRealMediaWindowlessSite::ComputeRegion()
void CRealMediaWindowlessSite::SubtractSite(REGION* pRegion)
{
PNxPoint topLeft;
- memset(&topLeft, 0, sizeof(PNxPoint));
+ ZeroMemory(&topLeft, sizeof(PNxPoint));
GetTopLeft(&topLeft);
REGION* pTempRegion = RMACreateRectRegion(topLeft.x, topLeft.y, topLeft.x + m_size.cx, topLeft.y + m_size.cy);
@@ -674,7 +674,7 @@ STDMETHODIMP CRealMediaWindowlessSite::OptimizedBlt(UCHAR* /*IN*/ pImageBits, RE
}
PNxPoint origin;
- memset(&origin, 0, sizeof(PNxPoint));
+ ZeroMemory(&origin, sizeof(PNxPoint));
GetTopLeft(&origin);
PNxRect adjustedDestRect;
adjustedDestRect.left = rDestRect.left + origin.x;
@@ -708,7 +708,7 @@ STDMETHODIMP CRealMediaWindowlessSite::OptimizedBlt(UCHAR* /*IN*/ pImageBits, RE
STDMETHODIMP CRealMediaWindowlessSite::EndOptimizedBlt()
{
- memset(&m_bitmapInfo, 0, sizeof(m_bitmapInfo));
+ ZeroMemory(&m_bitmapInfo, sizeof(m_bitmapInfo));
return PNR_OK;
}
diff --git a/src/mpc-hc/ShaderAutoCompleteDlg.cpp b/src/mpc-hc/ShaderAutoCompleteDlg.cpp
index ac2cf879f..f93526a75 100644
--- a/src/mpc-hc/ShaderAutoCompleteDlg.cpp
+++ b/src/mpc-hc/ShaderAutoCompleteDlg.cpp
@@ -142,7 +142,7 @@ BOOL CShaderAutoCompleteDlg::OnInitDialog()
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
nullptr, nullptr, nullptr, nullptr);
- memset(&m_ti, 0, sizeof(m_ti));
+ ZeroMemory(&m_ti, sizeof(m_ti));
m_ti.cbSize = sizeof(TOOLINFO);
m_ti.uFlags = TTF_ABSOLUTE | TTF_TRACK;
m_ti.hwnd = m_hWnd;
diff --git a/src/mpc-hc/VMROSD.cpp b/src/mpc-hc/VMROSD.cpp
index 2d82a40d1..6d43a8222 100644
--- a/src/mpc-hc/VMROSD.cpp
+++ b/src/mpc-hc/VMROSD.cpp
@@ -61,7 +61,7 @@ CVMROSD::CVMROSD()
m_debugBrushBack.CreateSolidBrush(m_colors[OSD_DEBUGCLR]);
m_debugPenBorder.CreatePen(PS_SOLID, 1, m_colors[OSD_BORDER]);
- memset(&m_bitmapInfo, 0, sizeof(m_bitmapInfo));
+ ZeroMemory(&m_bitmapInfo, sizeof(m_bitmapInfo));
}
CVMROSD::~CVMROSD()
@@ -100,7 +100,7 @@ void CVMROSD::UpdateBitmap()
CWindowDC dc(m_pWnd);
m_memDC.DeleteDC();
- memset(&m_bitmapInfo, 0, sizeof(m_bitmapInfo));
+ ZeroMemory(&m_bitmapInfo, sizeof(m_bitmapInfo));
if (m_memDC.CreateCompatibleDC(&dc)) {
BITMAPINFO bmi;
diff --git a/src/mpc-hc/mplayerc.cpp b/src/mpc-hc/mplayerc.cpp
index c2bbfc648..3b1a24fe5 100644
--- a/src/mpc-hc/mplayerc.cpp
+++ b/src/mpc-hc/mplayerc.cpp
@@ -111,7 +111,7 @@ HICON LoadIcon(CString fn, bool fSmall)
}
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS != key.QueryStringValue(nullptr, buff, &len) || (ext = buff).Trim().IsEmpty()) {
break;
}
@@ -124,7 +124,7 @@ HICON LoadIcon(CString fn, bool fSmall)
CString icon;
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS != key.QueryStringValue(nullptr, buff, &len) || (icon = buff).Trim().IsEmpty()) {
break;
}
@@ -191,7 +191,7 @@ bool LoadType(CString fn, CString& type)
while (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, tmp)) {
len = _countof(buff);
- memset(buff, 0, sizeof(buff));
+ ZeroMemory(buff, sizeof(buff));
if (ERROR_SUCCESS != key.QueryStringValue(nullptr, buff, &len)) {
break;
@@ -283,10 +283,10 @@ CMPlayerCApp::CMPlayerCApp()
GetModuleFileNameEx(GetCurrentProcess(), m_hInstance, strApp, MAX_PATH);
m_strVersion = CFileVersionInfo::GetFileVersionStr(strApp);
- memset(&m_ColorControl, 0, sizeof(m_ColorControl));
+ ZeroMemory(&m_ColorControl, sizeof(m_ColorControl));
ResetColorControlRange();
- memset(&m_VMR9ColorControl, 0, sizeof(m_VMR9ColorControl));
+ ZeroMemory(&m_VMR9ColorControl, sizeof(m_VMR9ColorControl));
m_VMR9ColorControl[0].dwSize = sizeof(VMR9ProcAmpControlRange);
m_VMR9ColorControl[0].dwProperty = ProcAmpControl9_Brightness;
m_VMR9ColorControl[1].dwSize = sizeof(VMR9ProcAmpControlRange);
@@ -296,7 +296,7 @@ CMPlayerCApp::CMPlayerCApp()
m_VMR9ColorControl[3].dwSize = sizeof(VMR9ProcAmpControlRange);
m_VMR9ColorControl[3].dwProperty = ProcAmpControl9_Saturation;
- memset(&m_EVRColorControl, 0, sizeof(m_EVRColorControl));
+ ZeroMemory(&m_EVRColorControl, sizeof(m_EVRColorControl));
GetRemoteControlCode = GetRemoteControlCodeMicrosoft;
}
@@ -1162,7 +1162,7 @@ BOOL CMPlayerCApp::InitInstance()
HICON icon = LoadIcon(IDR_MAINFRAME);
WNDCLASS wndcls;
- memset(&wndcls, 0, sizeof(WNDCLASS));
+ ZeroMemory(&wndcls, sizeof(WNDCLASS));
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wndcls.lpfnWndProc = ::DefWindowProc;
wndcls.hInstance = AfxGetInstanceHandle();
@@ -1859,7 +1859,7 @@ void SetDispMode(const dispmode& dm, CString& DisplayName)
return;
}
DEVMODE dmScreenSettings;
- memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
+ ZeroMemory(&dmScreenSettings, sizeof(dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
dmScreenSettings.dmPelsWidth = dm.size.cx;
dmScreenSettings.dmPelsHeight = dm.size.cy;
@@ -2514,7 +2514,7 @@ bool CMPlayerCApp::SetLanguage(const LanguageResource& languageResource, bool sh
void CMPlayerCApp::RunAsAdministrator(LPCTSTR strCommand, LPCTSTR strArgs, bool bWaitProcess)
{
SHELLEXECUTEINFO execinfo;
- memset(&execinfo, 0, sizeof(execinfo));
+ ZeroMemory(&execinfo, sizeof(execinfo));
execinfo.lpFile = strCommand;
execinfo.cbSize = sizeof(execinfo);
execinfo.lpVerb = _T("runas");