[Scummvm-cvs-logs] CVS: scummvm/sound audiocd.cpp,1.17,1.18

Gregory Montoir cyx at users.sourceforge.net
Wed Apr 13 12:53:24 CEST 2005


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18342/sound

Modified Files:
	audiocd.cpp 
Log Message:
Only cache a track if it really exists, this should prevent some issues when playing with invalid compressed tracks. See also bug report #1181979.

Index: audiocd.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiocd.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- audiocd.cpp	12 Mar 2005 18:56:05 -0000	1.17
+++ audiocd.cpp	13 Apr 2005 19:50:58 -0000	1.18
@@ -151,14 +151,15 @@
 	// First, delete the previous track info object
 	delete _track_info[current_index];
 	_track_info[current_index] = NULL;
-
-	_cached_tracks[current_index] = track;
+	_cached_tracks[current_index] = 0;
 
 	for (i = 0; i < ARRAYSIZE(TRACK_FORMATS)-1 && _track_info[current_index] == NULL; ++i)
 		_track_info[current_index] = TRACK_FORMATS[i].openTrackFunction(track);
 
-	if (_track_info[current_index] != NULL)
+	if (_track_info[current_index] != NULL) {
+		_cached_tracks[current_index] = track;
 		return current_index;
+	}
 
 	debug(2, "Track %d not available in compressed format", track);
 	return -1;





More information about the Scummvm-git-logs mailing list