[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_sound.cpp,1.17,1.18

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sat Aug 30 15:19:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv23588/driver

Modified Files:
	d_sound.cpp 
Log Message:
BS2 crashed because it passed a buffer of uneven length to the mixer. This
is the only place I can think of where this could have happened, so I've
added a paranoid check to ensure the buffer length is even.

Let's see how that works out...


Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_sound.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- d_sound.cpp	30 Aug 2003 21:09:13 -0000	1.17
+++ d_sound.cpp	30 Aug 2003 22:17:59 -0000	1.18
@@ -1925,6 +1925,10 @@
 					if (soundHandleMusic[i] == 0) {
 						soundHandleMusic[i] = g_engine->_mixer->newStream(data16, bufferSizeMusic, 22050, SoundMixer::FLAG_16BITS, 100000);
 					} else {
+						// Paranoid check that seems to
+						// be necessary.
+						if (len & 1)
+							len--;
 						g_engine->_mixer->appendStream(soundHandleMusic[i], data16, len);
 					}
 





More information about the Scummvm-git-logs mailing list