[Scummvm-cvs-logs] SF.net SVN: scummvm: [25614] scummvm/trunk/engines/parallaction/commands. cpp
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Thu Feb 15 22:43:57 CET 2007
Revision: 25614
http://scummvm.svn.sourceforge.net/scummvm/?rev=25614&view=rev
Author: peres001
Date: 2007-02-15 13:43:56 -0800 (Thu, 15 Feb 2007)
Log Message:
-----------
fixed a bug in the original engine causing memory-protected systems to occasionally crash
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/commands.cpp
Modified: scummvm/trunk/engines/parallaction/commands.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/commands.cpp 2007-02-15 21:42:57 UTC (rev 25613)
+++ scummvm/trunk/engines/parallaction/commands.cpp 2007-02-15 21:43:56 UTC (rev 25614)
@@ -295,11 +295,19 @@
break;
case CMD_ON: // on
- u->_zone->_flags &= ~kFlagsRemove;
- u->_zone->_flags |= kFlagsActive;
- if ((u->_zone->_type & 0xFFFF) == kZoneGet) {
- addJob(&jobDisplayDroppedItem, u->_zone, kPriority17 );
- }
+ // WORKAROUND: the original DOS-based engine didn't check u->_zone before dereferencing
+ // the pointer to get structure members, thus leading to crashes in systems with memory
+ // protection.
+ // As a side note, the overwritten address is the 5th entry in the DOS interrupt table
+ // (print screen handler): this suggests that a system would hang when the print screen
+ // key is pressed after playing Nippon Safes, provided that this code path is taken.
+ if (u->_zone != NULL) {
+ u->_zone->_flags &= ~kFlagsRemove;
+ u->_zone->_flags |= kFlagsActive;
+ if ((u->_zone->_type & 0xFFFF) == kZoneGet) {
+ addJob(&jobDisplayDroppedItem, u->_zone, kPriority17 );
+ }
+ }
break;
case CMD_OFF: // off
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list