Opened 19 years ago
Closed 19 years ago
Last modified 4 years ago
#1403 closed defect (fixed)
PASS: Invalid write in Loom demo
|Reported by:||Kirben||Owned by:||fingolfin|
Latest ScummVM cvs version. Passport to Adventure Compiled under mingw with GCC 3.2.3 and running under Windows XP.
Valgrind reports an invalid write in setBoxFlags() when Bobbin enters the tent heading to the Elders. A log is attached.
Ticket imported from: #881132. Ticket imported from: bugs/1403.
Change History (7)
by , 19 years ago
comment:1 by , 19 years ago
That's obviously a direct consequence of the evil hack in that part.
comment:2 by , 19 years ago
OK, I only mentioned it as ScummVM crashes at that point in Loom demo of PASS sometimes, but not always.
comment:3 by , 19 years ago
Aye. Well that hack clearly *is* wrong, anyway :-)
Either, the value should be "clipped" (that is, something like if (ptr == box) box--; That's certainly not correct in any meaning of the word, but at least won't crash and is trivial to do any verify.
Or we should enlarge the rtMatrix-1 resource... we could for example make it exactly one box "bigger", and then fill that additional space with the data that follows in the resource file immediately after the box data (that will be the res matrix). That way, we'd essentially emulate the (buggy) behaviour of the original engine.
comment:4 by , 19 years ago
Adding that clip check to getBoxBaseAddr() for pass works and stops the valgrind warning. That clip check could replace the current checkRange() adjustment for earlier games. Maybe just add that clip check for scumm 1 - 4 games in getBoxBaseAddr(), replacing the current fixme ?
It might be best to emulate the buggy behaviour of original as you mentioned, so we end up with exact same data for boxes. But I will leave the decision up to you.
comment:5 by , 19 years ago
|Status:||new → closed|
comment:6 by , 4 years ago
|Component:||→ Engine: SCUMM|