[Scummvm-cvs-logs] scummvm master -> 8156201f2822c97ace15dab5971fa9707c0e1da0

sev- sev at scummvm.org
Sat May 14 14:42:14 CEST 2016


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

Summary:
4435902f1e PEGASUS: Add safety check.
a088d1fb10 PRINCE: Remove redundant check
b83672070a SKY: Add safety check
e482fd8a1a SWORD1: Remove redundant check.
8156201f28 WINTERMUTE: Remove redundant check.


Commit: 4435902f1e1d9265add6f23966f42b6cce753cd0
    https://github.com/scummvm/scummvm/commit/4435902f1e1d9265add6f23966f42b6cce753cd0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-14T11:31:51+02:00

Commit Message:
PEGASUS: Add safety check.

The code which follows in the method has this check, assuming that
a null dereference is potentially possible.

Changed paths:
    engines/pegasus/neighborhood/mars/mars.cpp



diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp
index df5a755..7c4a8a9 100644
--- a/engines/pegasus/neighborhood/mars/mars.cpp
+++ b/engines/pegasus/neighborhood/mars/mars.cpp
@@ -1950,7 +1950,7 @@ void Mars::pickedUpItem(Item *item) {
 }
 
 void Mars::dropItemIntoRoom(Item *item, Hotspot *dropSpot) {
-	if (dropSpot->getObjectID() == kAttackRobotHotSpotID) {
+	if (dropSpot && dropSpot->getObjectID() == kAttackRobotHotSpotID) {
 		_attackingItem = (InventoryItem *)item;
 		startExtraSequence(kMars48RobotDefends, kExtraCompletedFlag, kFilterNoInput);
 		loadLoopSound2("");


Commit: a088d1fb10813559bdef4c470c877116cee0fc82
    https://github.com/scummvm/scummvm/commit/a088d1fb10813559bdef4c470c877116cee0fc82
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-14T11:34:41+02:00

Commit Message:
PRINCE: Remove redundant check

Changed paths:
    engines/prince/prince.cpp



diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index b39d26e..f1fd5a2 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -1543,20 +1543,18 @@ void PrinceEngine::showAnim(Anim &anim) {
 
 	// make_special_shadow
 	if ((anim._flags & 0x80)) {
-		if (animSurface) {
-			DrawNode newDrawNode;
-			newDrawNode.posX = x;
-			newDrawNode.posY = y + animSurface->h - anim._shadowBack;
-			newDrawNode.posZ = Hero::kHeroShadowZ;
-			newDrawNode.width = 0;
-			newDrawNode.height = 0;
-			newDrawNode.scaleValue = _scaleValue;
-			newDrawNode.originalRoomSurface = nullptr;
-			newDrawNode.data = this;
-			newDrawNode.drawFunction = &Hero::showHeroShadow;
-			newDrawNode.s = animSurface;
-			_drawNodeList.push_back(newDrawNode);
-		}
+		DrawNode newDrawNode;
+		newDrawNode.posX = x;
+		newDrawNode.posY = y + animSurface->h - anim._shadowBack;
+		newDrawNode.posZ = Hero::kHeroShadowZ;
+		newDrawNode.width = 0;
+		newDrawNode.height = 0;
+		newDrawNode.scaleValue = _scaleValue;
+		newDrawNode.originalRoomSurface = nullptr;
+		newDrawNode.data = this;
+		newDrawNode.drawFunction = &Hero::showHeroShadow;
+		newDrawNode.s = animSurface;
+		_drawNodeList.push_back(newDrawNode);
 	}
 
 	//ShowFrameCodeShadow


Commit: b83672070a5b0f22021baef0f5ac0889bb570a45
    https://github.com/scummvm/scummvm/commit/b83672070a5b0f22021baef0f5ac0889bb570a45
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-14T11:42:43+02:00

Commit Message:
SKY: Add safety check

Changed paths:
    engines/sky/control.cpp



diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp
index 99e6daa..9f4b6c2 100644
--- a/engines/sky/control.cpp
+++ b/engines/sky/control.cpp
@@ -402,7 +402,8 @@ void Control::animClick(ConResource *pButton) {
 void Control::drawMainPanel() {
 	memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
 	_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
-	_controlPanel->drawToScreen(NO_MASK);
+	if (_controlPanel)
+		_controlPanel->drawToScreen(NO_MASK);
 	_exitButton->drawToScreen(NO_MASK);
 	_savePanButton->drawToScreen(NO_MASK);
 	_restorePanButton->drawToScreen(NO_MASK);


Commit: e482fd8a1ab879a16a2a1781ccaa7521c02ca621
    https://github.com/scummvm/scummvm/commit/e482fd8a1ab879a16a2a1781ccaa7521c02ca621
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-14T11:44:36+02:00

Commit Message:
SWORD1: Remove redundant check.

We're doing assert() in the same function.

Changed paths:
    engines/sword1/resman.cpp



diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 0a0324a..2f8b37d 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -327,13 +327,12 @@ Common::File *ResMan::resFile(uint32 id) {
 			Clu *closeClu = _openCluStart;
 			_openCluStart = _openCluStart->nextOpen;
 
-			if (closeClu) {
-				if (closeClu->file)
-					closeClu->file->close();
-				delete closeClu->file;
-				closeClu->file = NULL;
-				closeClu->nextOpen = NULL;
-			}
+			if (closeClu->file)
+				closeClu->file->close();
+			delete closeClu->file;
+			closeClu->file = NULL;
+			closeClu->nextOpen = NULL;
+
 			_openClus--;
 		}
 	}


Commit: 8156201f2822c97ace15dab5971fa9707c0e1da0
    https://github.com/scummvm/scummvm/commit/8156201f2822c97ace15dab5971fa9707c0e1da0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-14T11:48:33+02:00

Commit Message:
WINTERMUTE: Remove redundant check.

If new() was unsuccessful, then we should bail out immediately,
but we always assume we have enough memory for ScummVM.

Changed paths:
    engines/wintermute/ui/ui_window.cpp



diff --git a/engines/wintermute/ui/ui_window.cpp b/engines/wintermute/ui/ui_window.cpp
index 9f3cdea..34341d1 100644
--- a/engines/wintermute/ui/ui_window.cpp
+++ b/engines/wintermute/ui/ui_window.cpp
@@ -139,13 +139,12 @@ bool UIWindow::display(int offsetX, int offsetY) {
 			_shieldButton->setListener(this, _shieldButton, 0);
 			_shieldButton->_parent = this;
 		}
-		if (_shieldButton) {
-			_shieldButton->_posX = _shieldButton->_posY = 0;
-			_shieldButton->setWidth(_gameRef->_renderer->getWidth());
-			_shieldButton->setHeight(_gameRef->_renderer->getHeight());
 
-			_shieldButton->display();
-		}
+		_shieldButton->_posX = _shieldButton->_posY = 0;
+		_shieldButton->setWidth(_gameRef->_renderer->getWidth());
+		_shieldButton->setHeight(_gameRef->_renderer->getHeight());
+
+		_shieldButton->display();
 	}
 
 	if (!_visible) {






More information about the Scummvm-git-logs mailing list