[Scummvm-git-logs] scummvm master -> 3a066936b8be7cc81d7599afc26387116ccee8f6
digitall
noreply at scummvm.org
Tue Nov 28 13:28:30 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3a066936b8 DREAMWEB: Fix save parsing in querySaveMetaInfos
Commit: 3a066936b8be7cc81d7599afc26387116ccee8f6
https://github.com/scummvm/scummvm/commit/3a066936b8be7cc81d7599afc26387116ccee8f6
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-11-28T13:28:25Z
Commit Message:
DREAMWEB: Fix save parsing in querySaveMetaInfos
Save parsing in `querySaveMetaInfos` had an off-by-one error.
`listSaves` contains the correct parsing.
This caused save descriptions to accumulate a leading junk byte (0x02).
As saves were loaded and re-saved, this added more junk bytes until the
ScummVM list GUI either displayed an empty string or crashed.
This bug affected users differently depending on if they used the list
or grid view for saving and loading.
`querySaveMetaInfos` parsing now matches `listSaves`.
Fixes bug #14561
Changed paths:
engines/dreamweb/metaengine.cpp
diff --git a/engines/dreamweb/metaengine.cpp b/engines/dreamweb/metaengine.cpp
index 51fd01c2d53..77eb5b1c4cc 100644
--- a/engines/dreamweb/metaengine.cpp
+++ b/engines/dreamweb/metaengine.cpp
@@ -151,7 +151,7 @@ SaveStateList DreamWebMetaEngine::listSaves(const char *target) const {
if (!stream)
error("cannot open save file %s", file.c_str());
char name[17] = {};
- stream->seek(0x61);
+ stream->seek(0x61); // The actual description string starts at desc[1]
stream->read(name, sizeof(name) - 1);
delete stream;
@@ -180,19 +180,16 @@ SaveStateDescriptor DreamWebMetaEngine::querySaveMetaInfos(const char *target, i
DreamWeb::FileHeader header;
in->read((uint8 *)&header, sizeof(DreamWeb::FileHeader));
- Common::String saveName;
- byte descSize = header.len(0);
- byte i;
-
- for (i = 0; i < descSize; i++)
- saveName += (char)in->readByte();
+ char name[17] = {};
+ in->skip(1); // The actual description string starts at desc[1]
+ in->read(name, sizeof(name) - 1);
- SaveStateDescriptor desc(this, slot, saveName);
+ SaveStateDescriptor desc(this, slot, name);
// Check if there is a ScummVM data block
if (header.len(6) == SCUMMVM_BLOCK_MAGIC_SIZE) {
// Skip the game data
- for (i = 1; i <= 5; i++)
+ for (byte i = 1; i <= 5; i++)
in->skip(header.len(i));
uint32 tag = in->readUint32BE();
More information about the Scummvm-git-logs
mailing list