ScummVM 0.7.0CVS (Sep 11 2004 08:29:53)
Features compiled in: Vorbis FLAC MP3 zLib MPEG2
Description : when I try to launch the game with a save
game number in the command line, a debug console opens
and says "ERROR: saveLoadArrayOf: invalid filetype 0".
Buf if I launch the game first and then load a save
game, it works.
I tested with Monkey Island 2 and this doesn't happen.
Language : english
Platform : win32
The bug didn't exist in the previous build.
Logged In: YES
user_id=2715
Can you please attach a sample save game you are having
issues with?
Logged In: YES
user_id=1116515
Here's one save game (you can get another one, see my
previous bug report that had nothing to do with this).
A random save game
Logged In: YES
user_id=12935
Hi folks, I just found a net access over here (so far having a nice
vacation :-), and i noticed that this new MD5 save/load code looks
fishy. For one thing, it overwrites memory (Array out of bounds
access) since you copy 17 bytes to md5Backup, not 16; simply
change line 665 in saveload.cpp to:
memcpy(md5Backup, _gameMD5, 16);
The code afterwards is probably wrong, too: it matches the old and new
MD5 value; if they differ, it'll change exactly the first differing byte in
_gameMD5; but not the rest! So if the savegame MD5 starts with 1234...
and _gameMD5 with ABCD, you end up with something like A234...->
very bad.
Again, the solution would be to use memcmp / memcpy:
...
if (0 != memcmp(md5Backup, _gameMD5, 16)) {
warning("FOO");
}
memcpy(_gameMD5, md5Backup, 16);
...
Logged In: YES
user_id=2715
I confess to being a very bad programmer last night, pleading
commiting under the influence.
Fixed. Thanks fingolfin, enjoy the rest of your holiday :o)