From: Daniel R. <dtr...@us...> - 2005-06-24 18:15:20
|
Update of /cvsroot/bzflag/bzflag/src/bzflag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4890 Modified Files: sound.cxx Log Message: patch from rkr - don't try referencing out-of-bounds sound samples. fixes crash in menu on his machine. Index: sound.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzflag/sound.cxx,v retrieving revision 2.4 retrieving revision 2.5 diff -w -u -r2.4 -r2.5 --- sound.cxx 26 May 2005 18:56:20 -0000 2.4 +++ sound.cxx 24 Jun 2005 18:15:10 -0000 2.5 @@ -447,6 +447,7 @@ return; } SoundCommand s; + if (soundSamples.size() <= soundCode) return; if (soundSamples[soundCode].length == 0) return; s.cmd = important ? SQC_IWORLD_SFX : SQC_WORLD_SFX; s.code = soundCode; @@ -463,6 +464,7 @@ return; } SoundCommand s; + if (soundSamples.size() <= soundCode) return; if (soundSamples[soundCode].length == 0) return; s.cmd = SQC_LOCAL_SFX; s.code = soundCode; @@ -505,6 +507,7 @@ return; } SoundCommand s; + if (soundSamples.size() <= soundCode) return; if (soundSamples[soundCode].length == 0) return; s.cmd = SQC_FIXED_SFX; s.code = soundCode; |