Skip to content
Permalink
Browse files
Fixed bug 2140 - Track is played back with the wrong tempo
ny00

It seems like the test against MAXCHAN can safely be relocated after the check if (meep->event.type==ME_TEMPO), with no risk of memory corruption, at least in this function.
  • Loading branch information
slouken committed Nov 3, 2013
1 parent d2f3b3a commit e61e3ba58bf1bac2af008a6e00d29b02963d7929
Showing with 3 additions and 3 deletions.
  1. +3 −3 timidity/readmidi.c
@@ -673,15 +673,15 @@ static MidiEvent *groom_list(int32 divisions,int32 *eventsp,int32 *samplesp)
meep->event.time, meep->event.channel + 1,
meep->event.type, meep->event.a, meep->event.b);

if (meep->event.channel >= MAXCHAN)
skip_this_event=1;
else if (meep->event.type==ME_TEMPO)
if (meep->event.type==ME_TEMPO)
{
tempo=
meep->event.channel + meep->event.b * 256 + meep->event.a * 65536;
compute_sample_increment(tempo, divisions);
skip_this_event=1;
}
else if (meep->event.channel >= MAXCHAN)
skip_this_event=1;
else if ((quietchannels & (1<<meep->event.channel)))
skip_this_event=1;
else switch (meep->event.type)

0 comments on commit e61e3ba

Please sign in to comment.