aboutsummaryrefslogtreecommitdiff
path: root/engines/access/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/access/detection.cpp')
-rw-r--r--engines/access/detection.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp
index 3e70de3635..186fcbdf06 100644
--- a/engines/access/detection.cpp
+++ b/engines/access/detection.cpp
@@ -157,11 +157,9 @@ SaveStateList AccessMetaEngine::listSaves(const char *target) const {
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
if (in) {
- Access::AccessEngine::readSavegameHeader(in, header);
- saveList.push_back(SaveStateDescriptor(slot, header._saveName));
+ if (Access::AccessEngine::readSavegameHeader(in, header))
+ saveList.push_back(SaveStateDescriptor(slot, header._saveName));
- header._thumbnail->free();
- delete header._thumbnail;
delete in;
}
}
@@ -187,7 +185,11 @@ SaveStateDescriptor AccessMetaEngine::querySaveMetaInfos(const char *target, int
if (f) {
Access::AccessSavegameHeader header;
- Access::AccessEngine::readSavegameHeader(f, header);
+ if (!Access::AccessEngine::readSavegameHeader(f, header, false)) {
+ delete f;
+ return SaveStateDescriptor();
+ }
+
delete f;
// Create the return descriptor