Skip to content

Commit

Permalink
Fixed bug 1905 - Stack smashing when playing midi file
Browse files Browse the repository at this point in the history
manuel.montezelo

I am forwarding this bug from Debian's bug tracking system.

It is difficult to summarise the whole thread, but basically Freedink (a game using SDL) aborts when trying to play a midi file due to stack smashing protection functions, GCC fortifying options.

There is more information, including backtraces with files and lines where this is triggered, midi files and instructions on how to reproduce.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694260
  • Loading branch information
slouken committed Jun 9, 2013
1 parent e3bf971 commit bf19d22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion timidity/readmidi.c
Expand Up @@ -673,7 +673,9 @@ 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.type==ME_TEMPO)
if (meep->event.channel >= MAXCHAN)
skip_this_event=1;
else if (meep->event.type==ME_TEMPO)
{
tempo=
meep->event.channel + meep->event.b * 256 + meep->event.a * 65536;
Expand Down

0 comments on commit bf19d22

Please sign in to comment.