[Scummvm-cvs-logs] scummvm master -> 714976729d0badab3e7557f62036aac0b2e9cc4f

digitall digitall at scummvm.org
Thu Jun 23 19:41:12 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
714976729d SAGA: Fix for Bug #3324850 ("ITE (SAGA): crash in dog sewers")


Commit: 714976729d0badab3e7557f62036aac0b2e9cc4f
    https://github.com/scummvm/scummvm/commit/714976729d0badab3e7557f62036aac0b2e9cc4f
Author: D G Turner (digitall at scummvm.org)
Date: 2011-06-23T10:35:27-07:00

Commit Message:
SAGA: Fix for Bug #3324850 ("ITE (SAGA): crash in dog sewers")

This read of 1 byte past the end of the buffer has existed since
the dragonMove() function was implemented, but since the change
in bfb0986c to use ByteArray, this now causes an assertion due to
the stricter bounds checking.

This commit corrects the original issue.
Thanks to fuzzie for this fix.

Changed paths:
    engines/saga/actor_walk.cpp



diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp
index 5607fcd..ea33a09 100644
--- a/engines/saga/actor_walk.cpp
+++ b/engines/saga/actor_walk.cpp
@@ -1165,7 +1165,15 @@ void Actor::moveDragon(ActorData *actor) {
 		dir0 = actor->_actionDirection;
 		dir1 = actor->_tileDirections[actor->_walkStepIndex++];
 		dir2 = actor->_tileDirections[actor->_walkStepIndex];
-		dir3 = actor->_tileDirections[actor->_walkStepIndex + 1];
+		// Fix for Bug #3324850 ("ITE (SAGA): crash in dog sewers")
+		// If there were more than two steps left, get the third (next) step.
+		// Otherwise, store the second step again so the anim looks right.
+		// (If you stop the move instead, Rif isn't automatically knocked into
+		// the Sewer.)
+		if (actor->_walkStepIndex + 1 < actor->_walkStepsCount)
+			dir3 = actor->_tileDirections[actor->_walkStepIndex + 1];
+		else
+			dir3 = dir2;
 
 		if (dir0 != dir1){
 			actor->_actionDirection = dir0 = dir1;






More information about the Scummvm-git-logs mailing list