Skip to content

Commit

Permalink
Fixed bug 2140 - Track is played back with the wrong tempo
Browse files Browse the repository at this point in the history
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 e61e3ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions timidity/readmidi.c
Expand Up @@ -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)
Expand Down

0 comments on commit e61e3ba

Please sign in to comment.