Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1762 closed defect (fixed)

Impossible to start directly with a save game

Reported by: SF/sexyzeb Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: The Dig


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.

Ticket imported from: #1026290. Ticket imported from: bugs/1762.

Attachments (1)

dig.s13 (19.3 KB ) - added by SF/sexyzeb 19 years ago.
A random save game

Download all attachments as: .zip

Change History (7)

comment:1 by SF/ender, 19 years ago

Can you please attach a sample save game you are having issues with?

comment:2 by SF/ender, 19 years ago

Owner: set to SF/ender

by SF/sexyzeb, 19 years ago

Attachment: dig.s13 added

A random save game

comment:3 by SF/sexyzeb, 19 years ago

Here's one save game (you can get another one, see my previous bug report that had nothing to do with this).

comment:4 by fingolfin, 19 years ago

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); ...

comment:5 by SF/ender, 19 years ago

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)

comment:6 by SF/ender, 19 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.