1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# HG changeset patch
# User Sam Lantinga <slouken@libsdl.org>
# Date 1342998807 25200
# Node ID 56cad6484b04f83c8d42428c755a046678506436
# Parent c92001a2c18f628698c58aa4e05a7335d10d0e9e
Paul P Komkoff Jr fixed malloc/free mismatch in the MikMod driver
diff -r c92001a2c18f -r 56cad6484b04 CHANGES
--- a/CHANGES Sun Mar 04 21:32:47 2012 +0000
+++ b/CHANGES Sun Jul 22 16:13:27 2012 -0700
@@ -1,3 +1,7 @@
+1.2.13:
+Paul P Komkoff Jr - Sun Jul 22 16:12:28 PDT 2012
+ * Fixed malloc/free mismatch in the MikMod driver
+
1.2.12:
Sam Lantinga - Sat Jan 14 22:00:29 2012 -0500
* Fixed seek offset with SMPEG (was relative, should be absolute)
diff -r c92001a2c18f -r 56cad6484b04 dynamic_mod.c
--- a/dynamic_mod.c Sun Mar 04 21:32:47 2012 +0000
+++ b/dynamic_mod.c Sun Jul 22 16:13:27 2012 -0700
@@ -93,6 +93,13 @@
SDL_UnloadObject(mikmod.handle);
return -1;
}
+ mikmod.MikMod_free =
+ (void (*)(void*))
+ SDL_LoadFunction(mikmod.handle, "MikMod_free");
+ if ( mikmod.MikMod_free == NULL ) {
+ SDL_UnloadObject(mikmod.handle);
+ return -1;
+ }
mikmod.Player_Active =
(BOOL (*)(void))
SDL_LoadFunction(mikmod.handle, "Player_Active");
diff -r c92001a2c18f -r 56cad6484b04 dynamic_mod.h
--- a/dynamic_mod.h Sun Mar 04 21:32:47 2012 +0000
+++ b/dynamic_mod.h Sun Jul 22 16:13:27 2012 -0700
@@ -35,6 +35,7 @@
void (*MikMod_RegisterDriver)(struct MDRIVER*);
int* MikMod_errno;
char* (*MikMod_strerror)(int);
+ void (*MikMod_free)(void*);
BOOL (*Player_Active)(void);
void (*Player_Free)(MODULE*);
MODULE* (*Player_LoadGeneric)(MREADER*,int,BOOL);
diff -r c92001a2c18f -r 56cad6484b04 music_mod.c
--- a/music_mod.c Sun Mar 04 21:32:47 2012 +0000
+++ b/music_mod.c Sun Jul 22 16:13:27 2012 -0700
@@ -109,13 +109,13 @@
list = mikmod.MikMod_InfoDriver();
if ( list )
- free(list);
+ mikmod.MikMod_free(list);
else
mikmod.MikMod_RegisterDriver(mikmod.drv_nos);
list = mikmod.MikMod_InfoLoader();
if ( list )
- free(list);
+ mikmod.MikMod_free(list);
else
mikmod.MikMod_RegisterAllLoaders();
|