From: Holger Z. <hz...@us...> - 2005-06-27 08:46:24
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4861/src/jake2/sound Modified Files: WaveLoader.java Log Message: fix out of bounds exception in getWavinfo() Index: WaveLoader.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/WaveLoader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WaveLoader.java 26 Apr 2005 22:16:34 -0000 1.4 --- WaveLoader.java 27 Jun 2005 08:46:15 -0000 1.5 *************** *** 260,269 **** FindNextChunk("LIST"); if (data_p != 0) { ! s = new String(data_b, data_p + 28, 4); ! if (s.equals("MARK")) { // this is not a proper parse, but it works with cooledit... ! data_p += 24; ! i = GetLittleLong(); // samples in loop ! info.samples = info.loopstart + i; ! // Com_Printf("looped length: %i\n", i); } } --- 260,272 ---- FindNextChunk("LIST"); if (data_p != 0) { ! if (data_b.length >= data_p + 32) { ! s = new String(data_b, data_p + 28, 4); ! if (s.equals("MARK")) { // this is not a proper parse, but ! // it works with cooledit... ! data_p += 24; ! i = GetLittleLong(); // samples in loop ! info.samples = info.loopstart + i; ! // Com_Printf("looped length: %i\n", i); ! } } } *************** *** 284,290 **** if (samples < info.samples) Com.Error(Defines.ERR_DROP, "Sound " + name + " has a bad loop length"); ! } else info.samples = samples; ! info.dataofs = data_p; --- 287,295 ---- if (samples < info.samples) Com.Error(Defines.ERR_DROP, "Sound " + name + " has a bad loop length"); ! } else { info.samples = samples; ! if (info.loopstart > 0) info.samples -= info.loopstart; ! } ! info.dataofs = data_p; |