aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/toon/detection.cpp')
-rw-r--r--engines/toon/detection.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index e93d676d87..6eb38c4883 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -232,7 +232,11 @@ SaveStateDescriptor ToonMetaEngine::querySaveMetaInfos(const char *target, int s
SaveStateDescriptor desc(slot, saveName);
- Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*file);
+ Graphics::Surface *thumbnail;
+ if (!Graphics::loadThumbnail(*file, thumbnail)) {
+ delete file;
+ return SaveStateDescriptor();
+ }
desc.setThumbnail(thumbnail);
uint32 saveDate = file->readUint32BE();