# Patch for SDL\_mixer-1.2.7

**URL:** <https://discourse.libsdl.org/t/patch-for-sdl-mixer-1-2-7/13456>\
**Category:** SDL Development\
**Created:** [June 6, 2006, 10:13pm UTC](https://discourse.libsdl.org/t/patch-for-sdl-mixer-1-2-7/13456 "2006-06-06T22:13:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmanuel\_Anne](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/e/e9c0ed/32.png) [@Emmanuel\_Anne](https://discourse.libsdl.org/u/Emmanuel_Anne)\
**Post date:** [June 6, 2006, 10:13pm UTC](https://discourse.libsdl.org/t/patch-for-sdl-mixer-1-2-7/13456/1 "2006-06-06T22:13:43Z")

</div>

SDL\_mixer crashes if it has timidity support compiled in and if you just  
open it twice in the same program (for example to play things at  
different sample rates).  
So attached are a very simple program to test the bug (it creates a  
segfault with the standard sdl\_mixer-1.2.7), and the very tiny patch to  
fix it !

-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: test.c  
Type: text/x-csrc  
Size: 281 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060607/22fc2956/attachment.c](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060607/22fc2956/attachment.c)  
-------------- next part --------------  
diff -u -B -w -r old/SDL\_mixer-1.2.7/timidity/common.c new/SDL\_mixer-1.2.7/timidity/common.c  
— old/SDL\_mixer-1.2.7/timidity/common.c 2006-05-14 21:54:25.000000000 +0200  
+++ new/SDL\_mixer-1.2.7/timidity/common.c 2006-06-06 22:02:13.000000000 +0200  
@@ -113,7 +113,7 @@  
}

#ifdef DEFAULT\_PATH

- if (firsttime && (pathlist==NULL)) {

- if (firsttime || (pathlist==NULL)) {  
/\* Generate path list \*/  
add\_to\_pathlist(DEFAULT\_PATH);  
firsttime=0;  
@@ -244,4 +244,5 @@  
free(plp);  
plp = next\_plp;  
}
- pathlist = NULL;  
}
