[Scummvm-git-logs] scummvm master -> 578f9d2e5c754e49750ac854404f553790555926

bonki bonki at users.noreply.github.com
Sat Mar 17 21:06:41 CET 2018


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:
578f9d2e5c TUCKER: Fix incorrect transition of Lola animation


Commit: 578f9d2e5c754e49750ac854404f553790555926
    https://github.com/scummvm/scummvm/commit/578f9d2e5c754e49750ac854404f553790555926
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-03-17T21:00:33+01:00

Commit Message:
TUCKER: Fix incorrect transition of Lola animation

The original game unconditionally reads into _sprC02Table[] in
updateSprite() which results in out-of-bounds reads when a sprite's
_state is -1. To make sure that sprites update correctly under all
circumstances we always reset a sprite's animation data when it is
disabled (_state == -1). This most prominently fixes a bug where
Lola's transition from dancing -> sitting happens too late.

Fixes Trac#6644.

Changed paths:
    engines/tucker/tucker.cpp


diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 56247a1..5cd0f4a 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -2948,7 +2948,15 @@ void TuckerEngine::updateSprite(int i) {
 			_spritesTable[i]._animationFrame = 1;
 		}
 		if (_spritesTable[i]._state < 0 || !_sprC02Table[_spritesTable[i]._state]) {
-//			warning("Invalid state %d for sprite %d location %d", _spritesTable[i].state, i, _locationNum);
+			// WORKAROUND
+			// The original game unconditionally reads into _sprC02Table[] below which
+			// results in out-of-bounds reads when _spritesTable[i]._state == -1.
+			// We reset the sprite's animation data in this case so sprite updates
+			// are triggered correctly. This most prominently fixes a bug where Lola's
+			// transition from dancing -> sitting happens too late.
+			// This fixes Trac#6644.
+			_spritesTable[i]._animationData = nullptr;
+			_spritesTable[i]._firstFrame = 0;
 			return;
 		}
 		_spritesTable[i]._animationData = _sprC02Table[_spritesTable[i]._state];





More information about the Scummvm-git-logs mailing list