[Scummvm-cvs-logs] CVS: scummvm/sound audiocd.cpp,1.4,1.5

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Thu Dec 11 00:19:02 CET 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv10285

Modified Files:
	audiocd.cpp 
Log Message:
Emergency bugfixes:

Initialise _cd.playing to false. Otherwise ScummVM may create a savegame
where a CD track appears to be playing, but everything about it is
undefined, causing ScummVM to crash when loading it.

Initialise _track_info[] with NULLs, otherwise ScummVM crashes for me when
I start the CD version of MI1.

There's probably a lot more that *should* be properly initialised, but this
seems to take care of the most serious issues, and is all I have the time
to do now anyway.


Index: audiocd.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiocd.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- audiocd.cpp	29 Nov 2003 23:40:21 -0000	1.4
+++ audiocd.cpp	11 Dec 2003 08:18:51 -0000	1.5
@@ -31,6 +31,8 @@
 
 AudioCDManager::AudioCDManager() {
 	_current_cache = 0;
+	_cd.playing = false;
+	memset(_track_info, 0, sizeof(_track_info));
 }
 
 void AudioCDManager::play(int track, int numLoops, int startFrame, int duration) {





More information about the Scummvm-git-logs mailing list