fix out-of-bounds access. VC2005 debug catches this, but VC2003 didn't.

This commit is contained in:
Chris Danford
2007-09-04 05:24:19 +00:00
parent 5a73f14767
commit bc21adef29
+1
View File
@@ -500,6 +500,7 @@ unsigned long MidiFileIn :: getNextEvent( std::vector<unsigned char> *event, uns
TempoChange tempoEvent = tempoEvents_[ trackTempoIndex_[track] ]; TempoChange tempoEvent = tempoEvents_[ trackTempoIndex_[track] ];
if( trackCounters_[track] >= tempoEvent.count ) if( trackCounters_[track] >= tempoEvent.count )
{ {
if( trackTempoIndex_[track] < tempoEvents_.size()-1 )
trackTempoIndex_[track]++; trackTempoIndex_[track]++;
tickSeconds_[track] = tempoEvent.tickSeconds; tickSeconds_[track] = tempoEvent.tickSeconds;
} }