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

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/DSUtilLite/DShowUtil.cpp27
-rw-r--r--common/DSUtilLite/DShowUtil.h2
-rw-r--r--decoder/LAVAudio/LAVAudio.cpp3
-rw-r--r--decoder/LAVVideo/LAVVideo.cpp3
-rw-r--r--demuxer/LAVSplitter/LAVSplitter.cpp8
5 files changed, 43 insertions, 0 deletions
diff --git a/common/DSUtilLite/DShowUtil.cpp b/common/DSUtilLite/DShowUtil.cpp
index 8d39c716..315a0716 100644
--- a/common/DSUtilLite/DShowUtil.cpp
+++ b/common/DSUtilLite/DShowUtil.cpp
@@ -23,6 +23,8 @@
#include <dvdmedia.h>
#include "moreuuids.h"
+#include "registry.h"
+
//
// Usage: SetThreadName (-1, "MainThread");
//
@@ -721,3 +723,28 @@ void __cdecl debugprintf(LPCWSTR format, ...)
OutputDebugString(buf);
}
+
+BOOL CheckApplicationBlackList(LPCTSTR subkey)
+{
+ HRESULT hr;
+ DWORD dwVal;
+ WCHAR fileName[1024];
+ GetModuleFileName(NULL, fileName, 1024);
+ WCHAR *processName = PathFindFileName(fileName);
+
+ // Check local machine path
+ CRegistry regLM = CRegistry(HKEY_LOCAL_MACHINE, subkey, hr, TRUE);
+ if (SUCCEEDED(hr)) {
+ dwVal = regLM.ReadDWORD(processName, hr);
+ return SUCCEEDED(hr) && dwVal;
+ }
+
+ // Check current user path
+ CRegistry regCU = CRegistry(HKEY_CURRENT_USER, subkey, hr, TRUE);
+ if (SUCCEEDED(hr)) {
+ dwVal = regCU.ReadDWORD(processName, hr);
+ return SUCCEEDED(hr) && dwVal;
+ }
+
+ return FALSE;
+}
diff --git a/common/DSUtilLite/DShowUtil.h b/common/DSUtilLite/DShowUtil.h
index fca55d20..c6aadf20 100644
--- a/common/DSUtilLite/DShowUtil.h
+++ b/common/DSUtilLite/DShowUtil.h
@@ -89,6 +89,8 @@ extern void UnRegisterSourceFilter(const GUID& subtype);
extern void RegisterProtocolSourceFilter(const CLSID& clsid, LPCWSTR protocol);
extern void UnRegisterProtocolSourceFilter(LPCWSTR protocol);
+extern BOOL CheckApplicationBlackList(LPCTSTR subkey);
+
// Locale
extern std::string ISO6391ToLanguage(LPCSTR code);
extern std::string ISO6392ToLanguage(LPCSTR code);
diff --git a/decoder/LAVAudio/LAVAudio.cpp b/decoder/LAVAudio/LAVAudio.cpp
index f8de1351..f251697a 100644
--- a/decoder/LAVAudio/LAVAudio.cpp
+++ b/decoder/LAVAudio/LAVAudio.cpp
@@ -1432,6 +1432,9 @@ HRESULT CLAVAudio::CheckConnect(PIN_DIRECTION dir, IPin *pPin)
{
DbgLog((LOG_TRACE, 5, L"CheckConnect -- %S", dir == PINDIR_INPUT ? "in" : "out"));
if (dir == PINDIR_INPUT) {
+ if (!m_bRuntimeConfig && CheckApplicationBlackList(LAVC_AUDIO_REGISTRY_KEY L"\\Blacklist"))
+ return E_FAIL;
+
// TODO: Check if the upstream source filter is LAVFSplitter, and store that somewhere
// Validate that this is called before any media type negotiation
} else if (dir == PINDIR_OUTPUT) {
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp
index a6e194c9..d40a8eb6 100644
--- a/decoder/LAVVideo/LAVVideo.cpp
+++ b/decoder/LAVVideo/LAVVideo.cpp
@@ -770,6 +770,9 @@ HRESULT CLAVVideo::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, doubl
HRESULT CLAVVideo::CheckConnect(PIN_DIRECTION dir, IPin *pPin)
{
if (dir == PINDIR_INPUT) {
+ if (!m_bRuntimeConfig && CheckApplicationBlackList(LAVC_VIDEO_REGISTRY_KEY L"\\Blacklist"))
+ return E_FAIL;
+
if (FilterInGraphSafe(pPin, CLSID_LAVVideo, TRUE)) {
DbgLog((LOG_TRACE, 10, L"CLAVVideo::CheckConnect(): LAVVideo is already in this graph branch, aborting."));
return E_FAIL;
diff --git a/demuxer/LAVSplitter/LAVSplitter.cpp b/demuxer/LAVSplitter/LAVSplitter.cpp
index de823403..7e1c534d 100644
--- a/demuxer/LAVSplitter/LAVSplitter.cpp
+++ b/demuxer/LAVSplitter/LAVSplitter.cpp
@@ -479,6 +479,10 @@ STDMETHODIMP CLAVSplitter::CompleteInputConnection()
HRESULT hr = S_OK;
BOOL bFileInput = FALSE;
+ // Check if blacklisted
+ if (!m_bRuntimeConfig && CheckApplicationBlackList(LAVF_REGISTRY_KEY L"\\Blacklist"))
+ return E_FAIL;
+
SAFE_DELETE(m_pDemuxer);
AVIOContext *pContext = nullptr;
@@ -533,6 +537,10 @@ STDMETHODIMP CLAVSplitter::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE * pmt
CheckPointer(pszFileName, E_POINTER);
if (m_State != State_Stopped) return E_UNEXPECTED;
+ // Check if blacklisted
+ if (!m_bRuntimeConfig && CheckApplicationBlackList(LAVF_REGISTRY_KEY L"\\Blacklist"))
+ return E_FAIL;
+
// Close, just in case we're being re-used
Close();