From d1ecb0122c0647dcafc75dbf8ba699ee9c071b79 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Fri, 5 Jan 2007 22:45:29 +0000 Subject: got rid of an assertion triggered when trying to play a speech file after switching from silent mode to talk mode. Minor cleanup. svn-id: r25010 --- engines/touche/resource.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/touche/resource.cpp') diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index f047cd8bd7..bd96793259 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -115,7 +115,7 @@ void ToucheEngine::res_allocateTables() { } } - _programData = (uint8 *)malloc(61440); + _programData = (uint8 *)malloc(kMaxProgramDataSize); if (!_programData) { error("Unable to allocate memory for program data"); } @@ -240,6 +240,7 @@ void ToucheEngine::res_loadProgram(int num) { debugC(9, kDebugResource, "ToucheEngine::res_loadProgram() num=%d", num); const uint32 offs = res_getDataOffset(kResourceTypeProgram, num, &_programDataSize); _fData.seek(offs); + assert(_programDataSize < kMaxProgramDataSize); _fData.read(_programData, _programDataSize); } @@ -622,7 +623,7 @@ void ToucheEngine::res_loadSpeech(int num) { void ToucheEngine::res_loadSpeechSegment(int num) { debugC(9, kDebugResource, "ToucheEngine::res_loadSpeechSegment() num=%d", num); - if (_talkTextMode != kTalkModeTextOnly) { + if (_talkTextMode != kTalkModeTextOnly && _flagsTable[617] != 0) { Audio::AudioStream *stream = 0; if (_compressedSpeechData < 0) { // uncompressed speech data int i = 0; -- cgit v1.2.3