summaryrefslogtreecommitdiff
path: root/third_party/libpng16/0000-build-config.patch
blob: 7b7b158f32570899b241991a583b23e09ee50ed3 (plain)
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
diff a/third_party/libpng16/pngmem.c b/third_party/libpng16/pngmem.c
--- a/third_party/libpng16/pngmem.c
+++ b/third_party/libpng16/pngmem.c
@@ -19,6 +19,9 @@
 
 #include "pngpriv.h"
 
+void*	FXMEM_DefaultAlloc(int byte_size, int);
+void	FXMEM_DefaultFree(void* pointer, int);
+
 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
 /* Free a png_struct */
 void /* PRIVATE */
@@ -92,7 +95,7 @@
 
       else
 #endif
-         return malloc((size_t)size); /* checked for truncation above */
+         return FXMEM_DefaultAlloc((int)size, 0);
    }
 
    else
@@ -249,7 +252,7 @@
       return;
 #endif /* USER_MEM */
 
-   free(ptr);
+   FXMEM_DefaultFree(ptr, 0);
 }
 
 #ifdef PNG_USER_MEM_SUPPORTED
diff a/third_party/libpng16/pngstruct.h b/third_party/libpng16/pngstruct.h
--- a/third_party/libpng16/pngstruct.h
+++ b/third_party/libpng16/pngstruct.h
@@ -27,7 +27,7 @@
    /* We must ensure that zlib uses 'const' in declarations. */
 #  define ZLIB_CONST
 #endif
-#include "zlib.h"
+#include "third_party/zlib_v128/zlib.h"
 #ifdef const
    /* zlib.h sometimes #defines const to nothing, undo this. */
 #  undef const