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 /src/filters/parser
parentad972ce4f3a448ea45198230d2ff2668d675f6c8 (diff)
Replace memset with ZeroMemory.
The ZeroMemory macro makes clear what it does compared to `memset(foo, 0, bar)`.
Diffstat (limited to 'src/filters/parser')
-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
16 files changed, 105 insertions, 105 deletions
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();