aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDavid Turner2010-12-06 23:15:25 +0000
committerDavid Turner2010-12-06 23:15:25 +0000
commit8ca0b867e0f5127cf192b7cb7a7c12216a9545a4 (patch)
tree24262e0b303dd9042469ab4a16ad166511dd6d1d /engines
parentedf4b1926bd7365d5b88c9e344aca35cf44da4db (diff)
downloadscummvm-rg350-8ca0b867e0f5127cf192b7cb7a7c12216a9545a4.tar.gz
scummvm-rg350-8ca0b867e0f5127cf192b7cb7a7c12216a9545a4.tar.bz2
scummvm-rg350-8ca0b867e0f5127cf192b7cb7a7c12216a9545a4.zip
HUGO: Fixed Valgrind Errors and Segfault when hugo.dat is missing.
svn-id: r54804
Diffstat (limited to 'engines')
-rw-r--r--engines/hugo/hugo.cpp2
-rw-r--r--engines/hugo/object.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 629e7e6e7d..c9f7edb32a 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -65,7 +65,7 @@ command_t _line; // Line of user text input
HugoEngine::HugoEngine(OSystem *syst, const HugoGameDescription *gd) : Engine(syst), _gameDescription(gd), _mouseX(0), _mouseY(0),
_textData(0), _stringtData(0), _screenNames(0), _textEngine(0), _textIntro(0), _textMouse(0), _textParser(0), _textUtil(0),
_arrayNouns(0), _arrayVerbs(0), _arrayReqs(0), _hotspots(0), _invent(0), _uses(0), _catchallList(0), _backgroundObjects(0),
- _points(0), _cmdList(0), _screenActs(0), _heroImage(0), _defltTunes(0), _introX(0), _introY(0), _maxInvent(0), _numBonuses(0),
+ _points(0), _cmdList(0), _screenActs(0), _hero(0), _heroImage(0), _defltTunes(0), _introX(0), _introY(0), _maxInvent(0), _numBonuses(0),
_numScreens(0), _tunesNbr(0), _soundSilence(0), _soundTest(0), _screenStates(0), _score(0), _maxscore(0),
_backgroundObjectsSize(0), _screenActsSize(0), _usesSize(0)
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index 6597e89cef..550d803bfb 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -48,6 +48,7 @@ namespace Hugo {
ObjectHandler::ObjectHandler(HugoEngine *vm) : _vm(vm), _objects(0) {
_numObj = 0;
+ _objCount = 0;
}
ObjectHandler::~ObjectHandler() {
@@ -211,7 +212,7 @@ void ObjectHandler::freeObjects() {
debugC(1, kDebugObject, "freeObjects");
// Nothing to do if not allocated yet
- if (_vm->_hero->seqList[0].seqPtr == 0)
+ if (_vm->_hero == 0 || _vm->_hero->seqList[0].seqPtr == 0)
return;
// Free all sequence lists and image data