[Scummvm-cvs-logs] SF.net SVN: scummvm: [27128] scummvm/trunk/engines/agos/verb.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Wed Jun 6 07:54:05 CEST 2007


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

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

Modified Paths:
--------------
    scummvm/trunk/engines/agos/verb.cpp

Modified: scummvm/trunk/engines/agos/verb.cpp
===================================================================
--- scummvm/trunk/engines/agos/verb.cpp	2007-06-06 05:53:55 UTC (rev 27127)
+++ scummvm/trunk/engines/agos/verb.cpp	2007-06-06 05:54:03 UTC (rev 27128)
@@ -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