[Scummvm-cvs-logs] scummvm master -> 2dc70a9e8bd549a44a7263a5cbbf3adf753b9746

Strangerke Strangerke at scummvm.org
Sat May 24 12:56:39 CEST 2014


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

Summary:
e53743ddf9 TUCKER: Add a safeguard to avoid a potential out of bound access
2dc70a9e8b TUCKER: Add a couple of safeguards to avoid out of bound access during the display of credits


Commit: e53743ddf9a770e998f348c72ceb4ef6c39fa34b
    https://github.com/scummvm/scummvm/commit/e53743ddf9a770e998f348c72ceb4ef6c39fa34b
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-05-24T10:51:58+02:00

Commit Message:
TUCKER: Add a safeguard to avoid a potential out of bound access

Changed paths:
    engines/tucker/tucker.cpp



diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index adf4be6..03019bf 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -890,9 +890,8 @@ void TuckerEngine::updateCharPosition() {
 				if (action->_testFlag1Num < 500) {
 					if (action->_testFlag1Num >= 300)
 						error("updateCharPosition() - Unexpected value for _testFlag1Num : %d", action->_testFlag1Num);
-					if (_flagsTable[action->_testFlag1Num] != action->_testFlag1Value) {
+					if (_flagsTable[action->_testFlag1Num] != action->_testFlag1Value)
 						skip = false;
-					}
 				} else if (_inventoryItemsState[action->_testFlag1Num - 500] != action->_testFlag1Value) {
 					skip = false;
 				}
@@ -900,9 +899,10 @@ void TuckerEngine::updateCharPosition() {
 			}
 			if (action->_testFlag2Num != 0) {
 				if (action->_testFlag2Num < 500) {
-					if (_flagsTable[action->_testFlag2Num] != action->_testFlag2Value) {
+					if (action->_testFlag2Num >= 300)
+						error("updateCharPosition() - Unexpected value for _testFlag1Num : %d", action->_testFlag1Num);
+					if (_flagsTable[action->_testFlag2Num] != action->_testFlag2Value)
 						skip = false;
-					}
 				} else if (_inventoryItemsState[action->_testFlag2Num - 500] != action->_testFlag2Value) {
 					skip = false;
 				}


Commit: 2dc70a9e8bd549a44a7263a5cbbf3adf753b9746
    https://github.com/scummvm/scummvm/commit/2dc70a9e8bd549a44a7263a5cbbf3adf753b9746
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-05-24T12:55:25+02:00

Commit Message:
TUCKER: Add a couple of safeguards to avoid out of bound access during the display of credits

Changed paths:
    engines/tucker/sequences.cpp
    engines/tucker/tucker.cpp



diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp
index 2fb881f..4a68c14 100644
--- a/engines/tucker/sequences.cpp
+++ b/engines/tucker/sequences.cpp
@@ -115,7 +115,8 @@ void TuckerEngine::handleCreditsSequence() {
 		if (counter4 == _creditsSequenceTimecounts[num]) {
 			_fadePaletteCounter = 0;
 			clearSprites();
-			++num;
+			if (num < 6)
+				++num;
 			Common::String filename;
 			if (num == 6) {
 				for (int i = 0; i < 16; ++i) {
@@ -123,6 +124,7 @@ void TuckerEngine::handleCreditsSequence() {
 					loadImage(filename.c_str(), imgBuf + i * 64000, 2);
 				}
 			} else {
+				filename = "";
 				switch (num) {
 				case 1:
 					filename = "loc75.pcx";
@@ -140,7 +142,8 @@ void TuckerEngine::handleCreditsSequence() {
 					filename = "loc78.pcx";
 					break;
 				}
-				loadImage(filename.c_str(), _quadBackgroundGfxBuf, 2);
+				if (filename != "")
+					loadImage(filename.c_str(), _quadBackgroundGfxBuf, 2);
 			}
 			_spritesCount = _creditsSequenceSpriteCounts[num];
 			++_flagsTable[236];
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 03019bf..3b35fc6 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -604,6 +604,7 @@ void TuckerEngine::mainLoop() {
 				_flagsTable[236] = 74;
 			}
 		}
+
 		if (_flagsTable[236] > 70) {
 			handleCreditsSequence();
 			_quitGame = true;






More information about the Scummvm-git-logs mailing list