aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/plugin.cpp8
-rw-r--r--engines/sword1/sword1.cpp7
2 files changed, 11 insertions, 4 deletions
diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp
index 5d37a8609c..cba5b77005 100644
--- a/engines/scumm/plugin.cpp
+++ b/engines/scumm/plugin.cpp
@@ -1318,14 +1318,18 @@ PluginError Engine_SCUMM_create(OSystem *syst, Engine **engine) {
}
+ FSList fslist;
FilesystemNode dir;
if (ConfMan.hasKey("path") )
dir = FilesystemNode(ConfMan.get("path"));
- FSList fslist = dir.listDir(FilesystemNode::kListFilesOnly);
- Common::List<DetectorResult> results;
+ if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+ warning("ScummEngine: invalid game path '%s'", dir.path().c_str());
+ return kInvalidPathError;
+ }
// Invoke the detector, but fixed to the specified gameid.
+ Common::List<DetectorResult> results;
detectGames(fslist, results, gameid);
// Unable to locate game data
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index b31df25db5..e57cadcff3 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -90,8 +90,11 @@ void Sword1CheckDirectory(const FSList &fslist, bool *filesFound) {
filesFound[cnt] = true;
} else {
for (int cnt = 0; cnt < ARRAYSIZE(g_dirNames); cnt++)
- if (scumm_stricmp(file->displayName().c_str(), g_dirNames[cnt]) == 0)
- Sword1CheckDirectory(file->listDir(FilesystemNode::kListFilesOnly), filesFound);
+ if (scumm_stricmp(file->displayName().c_str(), g_dirNames[cnt]) == 0) {
+ FSList fslist2;
+ if (file->listDir(fslist2, FilesystemNode::kListFilesOnly))
+ Sword1CheckDirectory(fslist2, filesFound);
+ }
}
}
}