1 changeset: 5320:d7f11bf8b7c8
2 user: Tony Vroon <chainsaw@gentoo.org>
3 date: Sun Jan 23 00:28:36 2011 +0000
4 summary: adplug: Two fixes (to protrack & rol) from Michael Schwendt, closes AUDPLUG-320.
6 diff -r 9f9d51fa2975 -r d7f11bf8b7c8 src/adplug/core/protrack.cxx
7 --- a/src/adplug/core/protrack.cxx Fri Jan 21 23:28:39 2011 -0500
8 +++ b/src/adplug/core/protrack.cxx Sun Jan 23 00:28:36 2011 +0000
13 + if (track >= npats*nchans) { // prevent overflow
17 AdPlug_LogWrite ("%3d%3d%2X%2X%2X|", tracks[track][row].note,
18 tracks[track][row].inst, tracks[track][row].command,
19 tracks[track][row].param1, tracks[track][row].param2);
20 diff -r 9f9d51fa2975 -r d7f11bf8b7c8 src/adplug/core/rol.cxx
21 --- a/src/adplug/core/rol.cxx Fri Jan 21 23:28:39 2011 -0500
22 +++ b/src/adplug/core/rol.cxx Sun Jan 23 00:28:36 2011 +0000
24 TVolumeEvents &vEvents = voiceData.volume_events;
25 TPitchEvents &pEvents = voiceData.pitch_events;
27 + if (iEvents.empty()) {
28 + return; // prevent out-of-bounds access
30 if( !(voiceData.mEventStatus & CVoiceData::kES_InstrEnd ) &&
31 iEvents[voiceData.next_instrument_event].time == mCurrTick )
37 + if (vEvents.empty()) {
38 + return; // prevent out-of-bounds access
40 if( !(voiceData.mEventStatus & CVoiceData::kES_VolumeEnd ) &&
41 vEvents[voiceData.next_volume_event].time == mCurrTick )
47 + if (pEvents.empty()) {
48 + return; // prevent out-of-bounds access
50 if( !(voiceData.mEventStatus & CVoiceData::kES_PitchEnd ) &&
51 pEvents[voiceData.next_pitch_event].time == mCurrTick )
55 int16 const num_tempo_events = f->readInt( 2 );
57 + if (num_tempo_events<0) {
60 mTempoEvents.reserve( num_tempo_events );
62 for(int i=0; i<num_tempo_events; ++i)
64 binistream *bnk_file, SBnkHeader const &bnk_header )
66 int16 const number_of_instrument_events = f->readInt( 2 );
67 + if (number_of_instrument_events<0) {
71 TInstrumentEvents &instrument_events = voice.instrument_events;
74 void CrolPlayer::load_volume_events( binistream *f, CVoiceData &voice )
76 int16 const number_of_volume_events = f->readInt( 2 );
77 + if (number_of_volume_events<0) {
81 TVolumeEvents &volume_events = voice.volume_events;
84 void CrolPlayer::load_pitch_events( binistream *f, CVoiceData &voice )
86 int16 const number_of_pitch_events = f->readInt( 2 );
87 + if (number_of_pitch_events<0) {
91 TPitchEvents &pitch_events = voice.pitch_events;