[Scummvm-cvs-logs] scummvm master -> 734abb5a53f498dcac30d4a9e6c5b37a57e6eb61

sev- sev at scummvm.org
Thu Oct 17 13:20:22 CEST 2013


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

Summary:
df73f27f67 DRASCULA: Fix potential buffer overrun. CID 1003308
66e6830395 DRASCULA: Fix potential buffer overrun. CID 1003309
bc08216659 DRASCULA: Fix potential buffer overrun. CID 1003310
b0ade3a637 DRASCULA: Fix potential buffer overrun. CID 1003311
9854911932 DRASCULA: Give hint about unused return value. CID 1003863
955b585bd0 DRASCULA: Fix uninitalized class variables. CID 1003403
787689ff32 TESTBED: Remove logically dead code. CID 1004067
08f5445055 TESTBED: Initialize variable. CID 1003374
208cd2cf95 TESTBED: Fix uninitalized variable. CID 1002670
54ebfe7dde DRACI: Fix potential division by zero. CID 1003841
74172a7449 DRACI: Fix potential negative array index read. CID 1003548
ae17206ce7 DRACI: Fix uninitalized variables. CID 1003405
ae38d943ae DRACI: Fix uninitalized variables. CID 1003406
78dc1c70d5 DRACI: Fix uninitialized variabled. CID 1003404
2a65976092 DRACI: Fix potential sign extention. CID 1003513
734abb5a53 DRACI: Fix potential sign extention. CID 1003514


Commit: df73f27f67eaa96e93f624ff641e20bd61f151d4
    https://github.com/scummvm/scummvm/commit/df73f27f67eaa96e93f624ff641e20bd61f151d4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:38:29-07:00

Commit Message:
DRASCULA: Fix potential buffer overrun. CID 1003308

Changed paths:
    engines/drascula/objects.cpp



diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp
index 35dfd31..acc4bbf 100644
--- a/engines/drascula/objects.cpp
+++ b/engines/drascula/objects.cpp
@@ -265,8 +265,9 @@ void DrasculaEngine::updateVisible() {
 		}
 		if (_roomNumber == 22 && flags[27] == 1)
 			visible[3] = 0;
-		if (_roomNumber == 26 && flags[21] == 0)
-			strcpy(objName[2], _textmisc[0]);
+		if (_roomNumber == 26 && flags[21] == 0) {
+			strlcpy(objName[2], _textmisc[0], 20);
+		}
 		if (_roomNumber == 26 && flags[18] == 1)
 			visible[2] = 0;
 		if (_roomNumber == 26 && flags[12] == 1)


Commit: 66e683039510ce0d1b08995d902a60e0ceef4e25
    https://github.com/scummvm/scummvm/commit/66e683039510ce0d1b08995d902a60e0ceef4e25
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:40:17-07:00

Commit Message:
DRASCULA: Fix potential buffer overrun. CID 1003309

Changed paths:
    engines/drascula/drascula.cpp



diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index cde00ba..d7e80ac 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -297,7 +297,7 @@ Common::Error DrasculaEngine::run() {
 		memset(iconName, 0, sizeof(iconName));
 
 		for (i = 0; i < 6; i++)
-			strcpy(iconName[i + 1], _textverbs[i]);
+			strlcpy(iconName[i + 1], _textverbs[i], 13);
 
 		assignPalette(defaultPalette);
 


Commit: bc082166596597b894b169ea82d06129c690e8bb
    https://github.com/scummvm/scummvm/commit/bc082166596597b894b169ea82d06129c690e8bb
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:43:21-07:00

Commit Message:
DRASCULA: Fix potential buffer overrun. CID 1003310

Changed paths:
    engines/drascula/graphics.cpp



diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index b28de66..a28ca8a 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -336,7 +336,7 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) {
 	// original starts printing 4 lines above textY
 	int y = CLIP<int>(textY - (4 * CHAR_HEIGHT), 0, 320);
 
-	strcpy(msg, message);
+	strlcpy(msg, message, 200);
 
 	// If the message fits on screen as-is, just print it here
 	if (textFitsCentered(msg, textX)) {
@@ -363,8 +363,8 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) {
 	while (curWord != NULL) {
 		// Check if the word and the current line fit on screen
 		if (tmpMessageLine[0] != '\0')
-			strcat(tmpMessageLine, " ");
-		strcat(tmpMessageLine, curWord);
+			strlcat(tmpMessageLine, " ", 200);
+		strlcat(tmpMessageLine, curWord, 200);
 		if (textFitsCentered(tmpMessageLine, textX)) {
 			// Line fits, so add the word to the current message line
 			strcpy(messageLine, tmpMessageLine);
@@ -374,8 +374,8 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) {
 			// If it goes off screen, print_abc will adjust it
 			x = CLIP<int>(textX - strlen(messageLine) * CHAR_WIDTH / 2, 60, 255);
 			print_abc(messageLine, x, y + curLine * CHAR_HEIGHT);
-			strcpy(messageLine, curWord);
-			strcpy(tmpMessageLine, curWord);
+			strlcpy(messageLine, curWord, 200);
+			strlcpy(tmpMessageLine, curWord, 200);
 			curLine++;
 		}
 


Commit: b0ade3a637be7a2b324a75d6d667d546975cbf82
    https://github.com/scummvm/scummvm/commit/b0ade3a637be7a2b324a75d6d667d546975cbf82
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:45:25-07:00

Commit Message:
DRASCULA: Fix potential buffer overrun. CID 1003311

Changed paths:
    engines/drascula/converse.cpp



diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp
index 95a5f7d..2aa12e1 100644
--- a/engines/drascula/converse.cpp
+++ b/engines/drascula/converse.cpp
@@ -168,19 +168,19 @@ void DrasculaEngine::converse(int index) {
 	// delete stream;
 
 	if (currentChapter == 2 && !strcmp(fileName, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
-		strcpy(phrase3, _text[405]);
+		strlcpy(phrase3, _text[405], 128);
 		strcpy(sound3, "405.als");
 		answer3 = 31;
 	}
 
 	if (currentChapter == 6 && !strcmp(fileName, "op_12.cal") && flags[7] == 1) {
-		strcpy(phrase3, _text[273]);
+		strlcpy(phrase3, _text[273], 128);
 		strcpy(sound3, "273.als");
 		answer3 = 14;
 	}
 
 	if (currentChapter == 6 && !strcmp(fileName, "op_12.cal") && flags[10] == 1) {
-		strcpy(phrase3, _text[274]);
+		strlcpy(phrase3, _text[274], 128);
 		strcpy(sound3, "274.als");
 		answer3 = 15;
 	}


Commit: 985491193258b3981db6a1879291e24ef4e3ed98
    https://github.com/scummvm/scummvm/commit/985491193258b3981db6a1879291e24ef4e3ed98
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:47:16-07:00

Commit Message:
DRASCULA: Give hint about unused return value. CID 1003863

Changed paths:
    engines/drascula/animation.cpp



diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index 1145c8c..ee981c3 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -1645,10 +1645,10 @@ void DrasculaEngine::animation_9_6() {
 
 	int v_cd;
 
-	animate("fin.bin", 14);
+	(void)animate("fin.bin", 14);
 	playMusic(13);
 	flags[5] = 1;
-	animate("drf.bin", 16);
+	(void)animate("drf.bin", 16);
 	fadeToBlack(0);
 	clearRoom();
 	curX = -1;


Commit: 955b585bd0fc2238ffbd6dac1edf1b3c5cc21ef8
    https://github.com/scummvm/scummvm/commit/955b585bd0fc2238ffbd6dac1edf1b3c5cc21ef8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:51:30-07:00

Commit Message:
DRASCULA: Fix uninitalized class variables. CID 1003403

Changed paths:
    engines/drascula/drascula.cpp



diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index d7e80ac..369e28c 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -89,6 +89,33 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
 	_talkSequences = 0;
 	_currentSaveSlot = 0;
 
+	bjX = 0;
+	bjY = 0;
+	trackBJ = 0;
+    framesWithoutAction = 0;
+	term_int = 0;
+	currentChapter = 0;
+	_loadedDifferentChapter = 0;
+	musicStopped = 0;
+	FrameSSN = 0;
+	globalSpeed = 0;
+	LastFrame = 0;
+	flag_tv = 0;
+	_charMapSize = 0;
+	_itemLocationsSize = 0;
+	_polXSize = 0;
+	_verbBarXSize = 0;
+	_x1dMenuSize = 0;
+	_frameXSize = 0;
+	_candleXSize = 0;
+	_pianistXSize = 0;
+	_drunkXSize = 0;
+	_roomPreUpdatesSize = 0;
+	_roomUpdatesSize = 0;
+	_roomActionsSize = 0;
+	_talkSequencesSize = 0;
+	_numLangs = 0;
+
 	_color = 0;
 	blinking = 0;
 	_mouseX = 0;


Commit: 787689ff3266b60a12dd2224bb0a8bf5cfca27a3
    https://github.com/scummvm/scummvm/commit/787689ff3266b60a12dd2224bb0a8bf5cfca27a3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:54:27-07:00

Commit Message:
TESTBED: Remove logically dead code. CID 1004067

Changed paths:
    engines/testbed/events.cpp



diff --git a/engines/testbed/events.cpp b/engines/testbed/events.cpp
index 78de87e..4b9ced2 100644
--- a/engines/testbed/events.cpp
+++ b/engines/testbed/events.cpp
@@ -83,11 +83,10 @@ struct keycodeToChar {
 
 char EventTests::keystrokeToChar() {
 	Common::EventManager *eventMan = g_system->getEventManager();
-	bool quitLoop = false;
 	Common::Event event;
 
 	// handle all keybd events
-	while (!quitLoop) {
+	while (true) {
 		while (eventMan->pollEvent(event)) {
 			// Quit if explicitly requested!
 			if (Engine::shouldQuit()) {
@@ -110,8 +109,6 @@ char EventTests::keystrokeToChar() {
 			}
 		}
 	}
-
-	return 0;
 }
 
 Common::Rect EventTests::drawFinishZone() {


Commit: 08f5445055aebaeafcaaaf422ccd632cbf9c78ba
    https://github.com/scummvm/scummvm/commit/08f5445055aebaeafcaaaf422ccd632cbf9c78ba
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:56:20-07:00

Commit Message:
TESTBED: Initialize variable. CID 1003374

Changed paths:
    engines/testbed/config-params.cpp



diff --git a/engines/testbed/config-params.cpp b/engines/testbed/config-params.cpp
index e89da0b..47e5dfa 100644
--- a/engines/testbed/config-params.cpp
+++ b/engines/testbed/config-params.cpp
@@ -38,6 +38,8 @@ ConfigParams::ConfigParams() {
 	_isInteractive = true;
 	_isGameDataFound = true;
 	_rerunTests = false;
+
+	_testbedConfMan = 0;
 }
 
 void ConfigParams::initLogging(const char *dirname, const char *filename, bool enable) {


Commit: 208cd2cf954b9da81945621ddab8489ab4620b96
    https://github.com/scummvm/scummvm/commit/208cd2cf954b9da81945621ddab8489ab4620b96
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T03:58:02-07:00

Commit Message:
TESTBED: Fix uninitalized variable. CID 1002670

Changed paths:
    engines/testbed/config.h



diff --git a/engines/testbed/config.h b/engines/testbed/config.h
index d611ae4..7d479a7 100644
--- a/engines/testbed/config.h
+++ b/engines/testbed/config.h
@@ -113,7 +113,7 @@ private:
 
 class TestbedInteractionDialog : public GUI::Dialog {
 public:
-	TestbedInteractionDialog(uint x, uint y, uint w, uint h) : GUI::Dialog(x, y, w, h) {}
+	TestbedInteractionDialog(uint x, uint y, uint w, uint h) : GUI::Dialog(x, y, w, h), _xOffset(0), _yOffset(0) {}
 	~TestbedInteractionDialog() {}
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 	void addButton(uint w, uint h, const Common::String name, uint32 cmd, uint xOffset = 0, uint yPadding = 8);


Commit: 54ebfe7dded15261e7cb14f3bc234d8eb4feddae
    https://github.com/scummvm/scummvm/commit/54ebfe7dded15261e7cb14f3bc234d8eb4feddae
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:01:49-07:00

Commit Message:
DRACI: Fix potential division by zero. CID 1003841

Changed paths:
    engines/draci/walking.cpp



diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index f1ae769..195b968 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -556,9 +556,15 @@ bool WalkingState::alignHeroToEdge(const Common::Point &p1, const Common::Point
 	}
 	bool reachedEnd;
 	if (movement == kMoveLeft || movement == kMoveRight) {
+		if (p2Diff.x == 0) {
+			error("Wrong value for horizontal movement");
+		}
 		reachedEnd = movement == kMoveLeft ? hero->x <= p2.x : hero->x >= p2.x;
 		hero->y += hero->x * p2Diff.y / p2Diff.x - prevHero.x * p2Diff.y / p2Diff.x;
 	} else {
+		if (p2Diff.y == 0) {
+			error("Wrong value for vertical movement");
+		}
 		reachedEnd = movement == kMoveUp ? hero->y <= p2.y : hero->y >= p2.y;
 		hero->x += hero->y * p2Diff.x / p2Diff.y - prevHero.y * p2Diff.x / p2Diff.y;
 	}


Commit: 74172a7449f957cc7bc29741676a32b03c5eb756
    https://github.com/scummvm/scummvm/commit/74172a7449f957cc7bc29741676a32b03c5eb756
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:03:37-07:00

Commit Message:
DRACI: Fix potential negative array index read. CID 1003548

Changed paths:
    engines/draci/game.cpp



diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index c4108cc..8fb6f4b 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -953,7 +953,7 @@ void Game::dialogueMenu(int dialogueID) {
 			"hit: %d, _lines[hit]: %d, lastblock: %d, dialogueLines: %d, dialogueExit: %d",
 			hit, _lines[hit], _lastBlock, _dialogueLinesNum, _dialogueExit);
 
-		if ((!_dialogueExit) && (hit != -1) && (_lines[hit] != -1)) {
+		if ((!_dialogueExit) && (hit >= 0) && (_lines[hit] != -1)) {
 			if ((oldLines == 1) && (_dialogueLinesNum == 1) && (_lines[hit] == _lastBlock)) {
 				break;
 			}


Commit: ae17206ce76c66738d0ff09c4d85d689d009fb20
    https://github.com/scummvm/scummvm/commit/ae17206ce76c66738d0ff09c4d85d689d009fb20
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:08:37-07:00

Commit Message:
DRACI: Fix uninitalized variables. CID 1003405

Changed paths:
    engines/draci/game.cpp



diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 8fb6f4b..271eb1e 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -52,6 +52,36 @@ enum {
 Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) {
 	uint i;
 
+	_dialogueLinesNum  = 0;
+	_blockNum = 0;
+
+	for (i = 0; i < kDialogueLines; i++)
+		_dialogueAnims[0] = 0;
+
+	_loopStatus = kStatusOrdinary;
+	_loopSubstatus = kOuterLoop;
+	_shouldQuit = 0;
+	_shouldExitLoop = 0;
+	_isReloaded = 0;
+	_speechTick = 0;
+	_speechDuration = 0;
+	_objUnderCursor = 0;
+	_animUnderCursor = 0;
+	_markedAnimationIndex = 0;
+	_scheduledPalette = 0;
+	_fadePhases = 0;
+	_fadePhase = 0;
+	_fadeTick = 0;
+	_mouseChangeTick = 0;
+	_enableQuickHero = 0;
+	_wantQuickHero = 0;
+	_enableSpeedText = 0;
+	_titleAnim = 0;
+	_inventoryAnim = 0;
+	_walkingMapOverlay = 0;
+	_walkingShortestPathOverlay = 0;
+	_walkingObliquePathOverlay = 0;
+
 	BArchive *initArchive = _vm->_initArchive;
 	const BAFile *file;
 


Commit: ae38d943ae7c032907ab96b60dbb88a04d1028d3
    https://github.com/scummvm/scummvm/commit/ae38d943ae7c032907ab96b60dbb88a04d1028d3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:11:07-07:00

Commit Message:
DRACI: Fix uninitalized variables. CID 1003406

Changed paths:
    engines/draci/draci.cpp



diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 6aa8477..06730cf 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -92,6 +92,32 @@ DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc)
 	DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info");
 
 	_console = new DraciConsole(this);
+
+	_screen = 0;
+	_mouse = 0;
+	_game = 0;
+	_script = 0;
+	_anims = 0;
+	_sound = 0;
+	_music = 0;
+	_smallFont = 0;
+	_bigFont = 0;
+	_iconsArchive = 0;
+	_objectsArchive = 0;
+	_spritesArchive = 0;
+	_paletteArchive = 0;
+	_roomsArchive = 0;
+	_overlaysArchive = 0;
+	_animationsArchive = 0;
+	_walkingMapsArchive = 0;
+	_itemsArchive = 0;
+	_itemImagesArchive = 0;
+	_initArchive = 0;
+	_stringsArchive = 0;
+	_soundsArchive = 0;
+	_dubbingArchive = 0;
+	_showWalkingMap = 0;
+	_pauseStartTime = 0;
 }
 
 bool DraciEngine::hasFeature(EngineFeature f) const {


Commit: 78dc1c70d5246bc54ba88e2804de86c4e875ce85
    https://github.com/scummvm/scummvm/commit/78dc1c70d5246bc54ba88e2804de86c4e875ce85
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:14:19-07:00

Commit Message:
DRACI: Fix uninitialized variabled. CID 1003404

Changed paths:
    engines/draci/walking.h



diff --git a/engines/draci/walking.h b/engines/draci/walking.h
index a43aeb2..7e4a318 100644
--- a/engines/draci/walking.h
+++ b/engines/draci/walking.h
@@ -103,7 +103,17 @@ struct GPL2Program;
 
 class WalkingState {
 public:
-	explicit WalkingState(DraciEngine *vm) : _vm(vm) { stopWalking(); }
+	explicit WalkingState(DraciEngine *vm) : _vm(vm) {
+		_dir = kDirectionLast;
+		_startingDirection = kMoveUndefined;
+		_segment = 0;
+		_lastAnimPhase = 0;
+		_turningFinished = 0;
+		_callbackOffset = 0;
+
+		stopWalking(); 
+	}
+
 	~WalkingState() {}
 
 	void stopWalking();


Commit: 2a65976092680957c7ee7b3aa39d84400b445c62
    https://github.com/scummvm/scummvm/commit/2a65976092680957c7ee7b3aa39d84400b445c62
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:16:23-07:00

Commit Message:
DRACI: Fix potential sign extention. CID 1003513

Changed paths:
    engines/draci/surface.cpp



diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp
index 3676c6e..4156398 100644
--- a/engines/draci/surface.cpp
+++ b/engines/draci/surface.cpp
@@ -82,7 +82,7 @@ void Surface::markClean() {
 void Surface::fill(uint color) {
 	byte *ptr = (byte *)getPixels();
 
-	memset(ptr, color, w * h);
+	memset(ptr, color, (uint)(w * h));
 }
 
 /**


Commit: 734abb5a53f498dcac30d4a9e6c5b37a57e6eb61
    https://github.com/scummvm/scummvm/commit/734abb5a53f498dcac30d4a9e6c5b37a57e6eb61
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-17T04:18:27-07:00

Commit Message:
DRACI: Fix potential sign extention. CID 1003514

Changed paths:
    engines/draci/sprite.cpp



diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp
index 965cdab..9a78904 100644
--- a/engines/draci/sprite.cpp
+++ b/engines/draci/sprite.cpp
@@ -38,9 +38,9 @@ const Displacement kNoDisplacement = { 0, 0, 1.0, 1.0 };
  *         height height of the image in the buffer
  */
 static void transformToRows(byte *img, uint16 width, uint16 height) {
-	byte *buf = new byte[width * height];
+	byte *buf = new byte[(uint)(width * height)];
 	byte *tmp = buf;
-	memcpy(buf, img, width * height);
+	memcpy(buf, img, (uint)(width * height));
 
 	for (uint16 i = 0; i < width; ++i) {
 		for (uint16 j = 0; j < height; ++j) {






More information about the Scummvm-git-logs mailing list