34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
|
|
# HG changeset patch
|
|
# User Sam Lantinga <slouken@libsdl.org>
|
|
# Date 1370738137 25200
|
|
# Node ID 0ff9b7b8ba7bb3eb8d15915dc405f161a3d3fde6
|
|
# Parent 669ddc9b26fb253bd529b38f2d6b149353ce8708
|
|
Fixed bug 1905 - Stack smashing when playing midi file
|
|
|
|
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
|
|
|
|
diff -r 669ddc9b26fb -r 0ff9b7b8ba7b timidity/readmidi.c
|
|
--- a/timidity/readmidi.c Fri Jun 07 21:52:34 2013 -0700
|
|
+++ b/timidity/readmidi.c Sat Jun 08 17:35:37 2013 -0700
|
|
@@ -673,7 +673,9 @@
|
|
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;
|
|
|