Fixed: When a file was selected for the Include command in the Configuration Editor that was not readable by the audio service, no warning appeared.
Fixed: When the Include command was used to load the configuration file itself or another file including the file, Equalizer APO could crash. The recursion depth is now limited to 100.
This commit is contained in:
1 parent
3d8ef28d1b
commit
f014bf4b7d
7 files changed
+249
-108
No files matched your search
@@ -27,11 +27,27 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
const int RECURSION_LIMIT = 100;
|
||||
|
||||
void IncludeFilterFactory::initialize(FilterEngine* engine)
|
||||
{
|
||||
this->engine = engine;
|
||||
}
|
||||
|
||||
vector<IFilter*> IncludeFilterFactory::startOfConfiguration()
|
||||
{
|
||||
recursionDepth = -1;
|
||||
|
||||
return vector<IFilter*>();
|
||||
}
|
||||
|
||||
vector<IFilter*> IncludeFilterFactory::startOfFile(const wstring& configPath)
|
||||
{
|
||||
recursionDepth++;
|
||||
|
||||
return vector<IFilter*>();
|
||||
}
|
||||
|
||||
vector<IFilter*> IncludeFilterFactory::createFilter(const wstring& configPath, wstring& command, wstring& parameters)
|
||||
{
|
||||
if (command == L"Include")
|
||||
@@ -56,9 +72,19 @@ vector<IFilter*> IncludeFilterFactory::createFilter(const wstring& configPath, w
|
||||
else
|
||||
includePath = value;
|
||||
|
||||
engine->loadConfigFile(includePath);
|
||||
if (recursionDepth >= RECURSION_LIMIT)
|
||||
LogF(L"Skipping include of %s as recursion limit of %d has been reached", value.c_str(), RECURSION_LIMIT);
|
||||
else
|
||||
engine->loadConfigFile(includePath);
|
||||
command = L"";
|
||||
}
|
||||
|
||||
return vector<IFilter*>();
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<IFilter*> IncludeFilterFactory::endOfFile(const wstring& configPath)
|
||||
{
|
||||
recursionDepth--;
|
||||
|
||||
return vector<IFilter*>();
|
||||
}
|
||||
Reference in new issue
Block a user