Return code for validateResource
|Reported by:||SF/jamieson630||Owned by:||SF/ender|
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.