[Scummvm-cvs-logs] SF.net SVN: scummvm: [25359] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Feb 3 22:14:35 CET 2007


Revision: 25359
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25359&view=rev
Author:   lordhoto
Date:     2007-02-03 13:14:35 -0800 (Sat, 03 Feb 2007)

Log Message:
-----------
Workaround bad values for _curSfxFile in old savegames.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra.cpp
    scummvm/trunk/engines/kyra/saveload.cpp

Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2007-02-03 20:50:26 UTC (rev 25358)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2007-02-03 21:14:35 UTC (rev 25359)
@@ -108,6 +108,8 @@
 	_quitFlag = false;
 	_currHeadShape = 0;
 
+	_curSfxFile = _curMusicTheme = 0;
+
 	// sets up all engine specific debug levels
 	Common::addSpecialDebugLevel(kDebugLevelScriptFuncs, "ScriptFuncs", "Script function debug level");
 	Common::addSpecialDebugLevel(kDebugLevelScript, "Script", "Script interpreter debug level");

Modified: scummvm/trunk/engines/kyra/saveload.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload.cpp	2007-02-03 20:50:26 UTC (rev 25358)
+++ scummvm/trunk/engines/kyra/saveload.cpp	2007-02-03 21:14:35 UTC (rev 25359)
@@ -206,6 +206,14 @@
 
 	if (version >= 7) {
 		_curSfxFile = in->readByte();
+
+
+		// In the first version there this entry was introduced,
+		// it wasn't made sure that _curSfxFile was initialized
+		// so if it's out of bounds we just set it to 0.
+		if (_curSfxFile >= _soundFilesTownsCount || _curSfxFile < 0)
+			_curSfxFile = 0;
+		
 		if (_flags.platform == Common::kPlatformFMTowns)
 			_sound->loadSoundFile(_curSfxFile);
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list