[Scummvm-cvs-logs] SF.net SVN: scummvm: [27127] scummvm/branches/branch-0-10-0/engines/agos/ verb.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Wed Jun 6 07:53:56 CEST 2007


Revision: 27127
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27127&view=rev
Author:   Kirben
Date:     2007-06-05 22:53:55 -0700 (Tue, 05 Jun 2007)

Log Message:
-----------
Fix crash, when the hitarea array overflows in the Amiga demo of Elvira 1.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agos/verb.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agos/verb.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agos/verb.cpp	2007-06-06 03:38:57 UTC (rev 27126)
+++ scummvm/branches/branch-0-10-0/engines/agos/verb.cpp	2007-06-06 05:53:55 UTC (rev 27127)
@@ -391,13 +391,15 @@
 
 HitArea *AGOSEngine::findEmptyHitArea() {
 	HitArea *ha = _hitAreas;
-	uint count = ARRAYSIZE(_hitAreas);
+	uint count = ARRAYSIZE(_hitAreas) - 1;
 
 	do {
 		if (ha->flags == 0)
 			return ha;
 	} while (ha++, --count);
-	return NULL;
+
+	// The last box is overwritten, if too many boxes are allocated.
+	return ha;
 }
 
 void AGOSEngine::freeBox(uint index) {


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