summaryrefslogtreecommitdiff
path: root/third_party/libpng/0000-build-config.patch
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-15 12:20:27 -0800
committerLei Zhang <thestig@chromium.org>2016-01-15 12:20:27 -0800
commitfa92864d257f57e5afdc0a36eafad8f2575c528a (patch)
treed792e53ea13f87d1fa2995127c864621b7701146 /third_party/libpng/0000-build-config.patch
parent45f2a47df2d6505c351ee0586969bf142c93bf6b (diff)
downloadpdfium-fa92864d257f57e5afdc0a36eafad8f2575c528a.tar.xz
XFA: Upgrade libpng to 1.6.20.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1591483003 .
Diffstat (limited to 'third_party/libpng/0000-build-config.patch')
-rw-r--r--third_party/libpng/0000-build-config.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/third_party/libpng/0000-build-config.patch b/third_party/libpng/0000-build-config.patch
new file mode 100644
index 0000000000..4f0013970a
--- /dev/null
+++ b/third_party/libpng/0000-build-config.patch
@@ -0,0 +1,43 @@
+diff a/third_party/libpng/pngmem.c b/third_party/libpng/pngmem.c
+--- a/third_party/libpng/pngmem.c
++++ b/third_party/libpng/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/libpng/pngstruct.h b/third_party/libpng/pngstruct.h
+--- a/third_party/libpng/pngstruct.h
++++ b/third_party/libpng/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