Opened 9 years ago

Closed 9 years ago

#5275 closed defect (fixed)

SCI: Bug in file read/write operations

Reported by: OmerMor Owned by: wjp
Priority: normal Component: Engine: SCI
Keywords: Cc:
Game: Hoyle's Classic Card Games

Description

Game version: 2.00/DOS/English
ScummVM version: 1.2.0svn52211
Platform: Windows7 32bit

I start a game (crazy eights), select characters (graham, pepper, willy), the game shows a b/w picture and then crashes.
The following is printed to the console:
picture resource 913 not found!

In DosBox the game works fine so It's not a faulty game.

Ticket imported from: #3049360. Ticket imported from: bugs/5275.

Attachments (2)

hoyle4-game.opt (35 bytes ) - added by OmerMor 9 years ago.
GAME.OPT.zip (131 bytes ) - added by OmerMor 9 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by bluegr, 9 years ago

Summary: Crash when starting a gameHoyle4: Crash when starting a game

comment:2 by bluegr, 9 years ago

It seems you got an invalid game.opt file (which contains the game options that the game saves). Search your game folder (game.opt), or your saves folder (hoyle4-game.opt) and rename it, and please attach it to this bug report

comment:3 by bluegr, 9 years ago

Owner: set to bluegr

comment:4 by bluegr, 9 years ago

Renaming this, it's a general issue with the way we read/write custom game files. Examples are Hoyle 3, Hoyle 4 and Phantasmagoria

comment:5 by bluegr, 9 years ago

Summary: Hoyle4: Crash when starting a gameSCI: Bug in file read/write operations

by OmerMor, 9 years ago

Attachment: hoyle4-game.opt added

by OmerMor, 9 years ago

Attachment: GAME.OPT.zip added

comment:6 by OmerMor, 9 years ago

I added game.opt (zipped) from the game folder, and hoyle4-game.opt from scummvm save folder. the problem seems to be that both are present. If only one is present the game works. however, if the file is present in the game folder, than the second one is generated by scummvm in the save folder, and next time the game is started the bugs occurs again.

comment:7 by bluegr, 9 years ago

Fixed in rev #52298 (we weren't checking for end of file, or file read errors)

comment:8 by bluegr, 9 years ago

Resolution: fixed
Status: newclosed

comment:9 by bluegr, 9 years ago

Status: closednew

comment:10 by bluegr, 9 years ago

Reopening, seems to still occur according to #3053089

comment:11 by bluegr, 9 years ago

Resolution: fixed

comment:12 by wjp, 9 years ago

It looks like this may be caused by fgets_wrapper reading 1 byte if maxsize is 1.
If I do *dest = 0 in that case instead of readByte(), the string in game.opt seems to be read more sensibly, and the crash is then gone.

(The current behaviour was added in r47575)

comment:13 by wjp, 9 years ago

After discussing it with thebluegr and m_kiewitz, I've committed this as r52396. Could you verify if that fixes it for you? (I'm leaving comment posting open on this ticket, so you should be able to reply without starting a new ticket this time.)

comment:14 by wjp, 9 years ago

Owner: changed from bluegr to wjp
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.