[Scummvm-cvs-logs] scummvm master -> f1817431dfc022f73b137ce8ca573e9864b2c64b

Strangerke Strangerke at scummvm.org
Thu Oct 31 08:06:50 CET 2013


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:
f1817431df HUGO: Fix CID 1063173, 1002888, 1002886


Commit: f1817431dfc022f73b137ce8ca573e9864b2c64b
    https://github.com/scummvm/scummvm/commit/f1817431dfc022f73b137ce8ca573e9864b2c64b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-31T00:06:14-07:00

Commit Message:
HUGO: Fix CID 1063173, 1002888, 1002886

Changed paths:
    engines/hugo/dialogs.cpp
    engines/hugo/display.cpp
    engines/hugo/file.cpp
    engines/hugo/hugo.cpp
    engines/hugo/hugo.h



diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp
index 5dcee3a..26a05c3 100644
--- a/engines/hugo/dialogs.cpp
+++ b/engines/hugo/dialogs.cpp
@@ -140,12 +140,10 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
 		_arrayBmp[i * 2] = bitmapSrc->convertTo(g_system->getOverlayFormat());
 		_arrayBmp[i * 2 + 1] = new Graphics::Surface();
 		_arrayBmp[i * 2 + 1]->create(_arrayBmp[i * 2]->w * 2, _arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat());
-		byte *src = (byte *)_arrayBmp[i * 2]->getPixels();
-		byte *dst = (byte *)_arrayBmp[i * 2 + 1]->getPixels();
 
 		for (int j = 0; j < _arrayBmp[i * 2]->h; j++) {
-			src = (byte *)_arrayBmp[i * 2]->getBasePtr(0, j);
-			dst = (byte *)_arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2);
+			byte *src = (byte *)_arrayBmp[i * 2]->getBasePtr(0, j);
+			byte *dst = (byte *)_arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2);
 			for (int k = _arrayBmp[i * 2]->w; k > 0; k--) {
 				for (int m = _arrayBmp[i * 2]->format.bytesPerPixel; m > 0; m--) {
 					*dst++ = *src++;
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index fbe39b3..4cb7f3e 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -100,6 +100,8 @@ Screen::Screen(HugoEngine *vm) : _vm(vm) {
 		_dlRestoreList[i]._dx = 0;
 		_dlRestoreList[i]._dy = 0;
 	}
+	_fnt = 0;
+	_paletteSize = 0;
 }
 
 Screen::~Screen() {
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index e58c2e5..a9f56de 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -519,6 +519,7 @@ void FileManager::readBootFile() {
 	ofp.read(_vm->_boot._pbswitch, sizeof(_vm->_boot._pbswitch));
 	ofp.read(_vm->_boot._distrib, sizeof(_vm->_boot._distrib));
 	_vm->_boot._exitLen = ofp.readUint16LE();
+	ofp.close();
 
 	byte *p = (byte *)&_vm->_boot;
 
@@ -527,7 +528,6 @@ void FileManager::readBootFile() {
 		checksum ^= p[i];
 		p[i] ^= s_bootCypher[i % s_bootCypherLen];
 	}
-	ofp.close();
 
 	if (checksum) {
 		Utils::notifyBox(Common::String::format("Corrupted startup file '%s'", getBootFilename()));
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index b140cfd..4d24c80 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -93,6 +93,26 @@ HugoEngine::HugoEngine(OSystem *syst, const HugoGameDescription *gd) : Engine(sy
 	_gameType = kGameTypeNone;
 	_platform = Common::kPlatformUnknown;
 	_packedFl = false;
+
+	_numVariant = 0;
+	_gameVariant = kGameVariantNone;
+	_normalTPS = 0;
+	_screenPtr = nullptr;
+	_config._musicFl = true;
+	_config._soundFl = true;
+	_config._turboFl = false;
+	_look = 0;
+	_take = 0;
+	_drop = 0;
+	_maze._enabledFl = false;
+	_maze._size = 0;
+	_maze._x1 = _maze._y1 = _maze._x2 = _maze._y2 = _maze._x3 = _maze._x4 = 0;
+	_maze._firstScreenIndex = 0;
+	_boot._checksum = 0;
+	_boot._registered = kRegShareware;
+	_boot._exitLen = 0;
+	_file = nullptr;
+	_scheduler = nullptr;
 }
 
 HugoEngine::~HugoEngine() {
diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h
index 9f495a9..176c250 100644
--- a/engines/hugo/hugo.h
+++ b/engines/hugo/hugo.h
@@ -106,7 +106,8 @@ enum GameVariant {
 	kGameVariantH3Win,
 	kGameVariantH1Dos,
 	kGameVariantH2Dos,
-	kGameVariantH3Dos
+	kGameVariantH3Dos,
+	kGameVariantNone
 };
 
 enum HugoDebugChannels {






More information about the Scummvm-git-logs mailing list