Opened 22 years ago

Closed 22 years ago

Last modified 6 years ago

#8063 closed patch

Return code for validateResource

Reported by: SF/jamieson630 Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Full Throttle

Description

This patch establishes a boolean return code for validateResource, and changes all references to validateResource to make use of the return code.

A return value of "true" indicates that the resource is valid; a return value of "false" indicates that it is invalid.

getResourceAddress, in particular, must check this value and not proceed if the resource is invalid. Otherwise, it ends up trying to load the resource anyway, which seems to create some allocation problems.

This patch is in response to an instability observed in Full Throttle. Upon entry to the fuel tower, a bad call to palManipulateInit is being made with an invalid string resource ID. Attempts to obtain the string resources resulted in bad allocations/loads/whatever from getResourceAddress, and caused the program to crash thereafter when trying to save the game (and possibly in other situations as well).

Thanks to eriktorbjorn for pointing out this problem.

This patches the following files: resource.cpp - Revision 1.11 scumm.h - Revision 1.28

Ticket imported from: #613933. Ticket imported from: patches/168.

Attachments (1)

validateResource.diff (3.4 KB ) - added by SF/jamieson630 22 years ago.
Patch against a September 24 CVS snapshot

Download all attachments as: .zip

Change History (4)

by SF/jamieson630, 22 years ago

Attachment: validateResource.diff added

Patch against a September 24 CVS snapshot

comment:1 by SF/ender, 22 years ago

Sensible fix, looks good :)

Applied, thanks.

comment:2 by SF/ender, 22 years ago

Owner: set to SF/ender
Status: newclosed

comment:3 by digitall, 6 years ago

Component: Engine: SCUMM
Game: Full Throttle
Note: See TracTickets for help on using tickets.