Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#913 closed defect (fixed)

[PATCH] Crash starting game on Oasis II

Reported by: vts Owned by: Michael D. Hafer
Priority: Should Have Milestone: Alpha 7
Component: Core engine Keywords:
Cc: Patch:

Description

Starting a game on Oasis II crashes the game. An PSERROR_File_InvalidType exception is thrown in ps/trunk/ps/FileIo.cpp at line 138, because the file size recorded in the the maps/scenarios/Oasis II.pmp file header does not add up to the actual file size.

Commit [9921] last updated the file to 659.456 bytes, but apparently the filesize recorded in the header did not get updated accordingly. This value should be the total file size minus the header size (which is 12) in little-endian order, so this can be fixed by setting bytes 8-12 to F4 0F 0A 00 (=659.444).

Assigned to Mythos_Ruler as he requested for this to be looked at on IRC. No patch attachment since this is a binary edit.

Change History (6)

comment:1 by historic_bruno, 13 years ago

Eh? This is an interesting problem. Shouldn't we make some attempt to recover files like this? Maybe notify the user, but continue trying to load the map anyway.

comment:2 by historic_bruno, 13 years ago

Milestone: BacklogAlpha 7

in reply to:  1 comment:3 by Philip Taylor, 13 years ago

Replying to historic_bruno:

Shouldn't we make some attempt to recover files like this? Maybe notify the user, but continue trying to load the map anyway.

The most common situation will probably be loading files that aren't map files at all, and they'll likely result in crazy memory allocations and nasty crashes if we continue trying to load them, so it's probably better not to do that until we're confident the map loader is robust. Also it would mask whatever error causes invalid files to get generated, so it's probably better to complain fatally about them so we're motivated to find and fix the real problem.

comment:4 by michael, 13 years ago

Can someone commit the edited/fixed pmp? :)

comment:5 by philip, 13 years ago

Resolution: fixed
Status: newclosed

(In [9945]) Fix #913 (corrupted map file)

comment:6 by sanderd17, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.