#4298 closed defect (fixed)
SCI: Resource Offset Endian Problem
Reported by: | SF/mthreepwood | Owned by: | wjp |
---|---|---|---|
Priority: | normal | Component: | Engine: SCI |
Version: | Keywords: | ||
Cc: | Game: | Space Quest 4 |
Description
I attempted to play SQ4 CD on my Mac OS X (10.4, PPC) with the latest trunk and I had some problems with the game's startup. I got io failed errors, which seemed abnormal to me. Searching a bit more, I found that the offset is read in with no regards to endianness.
Line 999, sci/scicore/resource.cpp: file.read(&off, nEntrySize - 2);
In this game, nEntrySize - 2 == 3. Reading it in in LE order fixes this problem (until the game crashes soon after for other reasons :P). However, I'm not sure what size can appear here so I don't want to commit a fix myself.
Ticket imported from: #2739122. Ticket imported from: bugs/4298.
Attachments (1)
Change History (5)
by , 16 years ago
Attachment: | sci_res_endian_fix.diff added |
---|
comment:2 by , 16 years ago
Thanks for spotting this. I committed a fix together with some extra simplification of that function.
One small extra remark: in your patch in "file.readUint16LE() + (file.readByte() << 16);" the order in which readUint16LE() and readByte() are executed isn't defined.
comment:3 by , 16 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:4 by , 6 years ago
Component: | → Engine: SCI |
---|---|
Game: | → Space Quest 4 |
Patch against latest trunk