diff options
author | Strangerke | 2014-05-24 12:55:25 +0200 |
---|---|---|
committer | Strangerke | 2014-05-24 12:55:25 +0200 |
commit | 2dc70a9e8bd549a44a7263a5cbbf3adf753b9746 (patch) | |
tree | cb730c74639263c08b8b7f1329f836de68484bdd /engines | |
parent | e53743ddf9a770e998f348c72ceb4ef6c39fa34b (diff) | |
download | scummvm-rg350-2dc70a9e8bd549a44a7263a5cbbf3adf753b9746.tar.gz scummvm-rg350-2dc70a9e8bd549a44a7263a5cbbf3adf753b9746.tar.bz2 scummvm-rg350-2dc70a9e8bd549a44a7263a5cbbf3adf753b9746.zip |
TUCKER: Add a couple of safeguards to avoid out of bound access during the display of credits
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tucker/sequences.cpp | 7 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 2fb881f77e..4a68c14eea 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 03019bfec5..3b35fc65be 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; |