diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2013-05-26 18:29:29 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2013-06-23 17:27:42 +0400 |
commit | e24ab62e1cefe4f73fe259fbf225fa14a948a188 (patch) | |
tree | 25605fffcf2470f4fb30e534caa76898b4f2c400 /src/filters | |
parent | ad972ce4f3a448ea45198230d2ff2668d675f6c8 (diff) |
Replace memset with ZeroMemory.
The ZeroMemory macro makes clear what it does compared to `memset(foo, 0, bar)`.
Diffstat (limited to 'src/filters')
51 files changed, 239 insertions, 240 deletions
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;
|