summaryrefslogtreecommitdiffstats
path: root/libraries/libglpng/patches/libglpng-1.45-libpng15.patch
diff options
context:
space:
mode:
author Matteo Bernardini <ponce@slackbuilds.org>2015-04-23 06:16:23 +0200
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2016-01-17 09:40:16 +0700
commita8bc7e8ef047a7c2191a30968b68158a13b1b043 (patch)
tree3b9e6a679561c7e56becb48e47eb5b78efe7bb05 /libraries/libglpng/patches/libglpng-1.45-libpng15.patch
parent53897510745f57b10474930e822b86ca4e9f2cd9 (diff)
downloadslackbuilds-a8bc7e8ef047a7c2191a30968b68158a13b1b043.tar.gz
slackbuilds-a8bc7e8ef047a7c2191a30968b68158a13b1b043.tar.xz
libraries/libglpng: Add two more patches (from fedora).
One for a CVE and another fix building against the newer libpng Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to '')
-rw-r--r--libraries/libglpng/patches/libglpng-1.45-libpng15.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/libraries/libglpng/patches/libglpng-1.45-libpng15.patch b/libraries/libglpng/patches/libglpng-1.45-libpng15.patch
new file mode 100644
index 0000000000..dcafea8fe3
--- /dev/null
+++ b/libraries/libglpng/patches/libglpng-1.45-libpng15.patch
@@ -0,0 +1,48 @@
+diff -up libglpng-1.45.orig/include/GL/glpng.h~ libglpng-1.45.orig/include/GL/glpng.h
+--- libglpng-1.45.orig/include/GL/glpng.h~ 2011-12-06 22:14:59.000000000 +0100
++++ libglpng-1.45.orig/include/GL/glpng.h 2011-12-06 22:15:48.900673919 +0100
+@@ -57,7 +57,7 @@ extern "C" {
+ #define PNG_SIMPLEMIPMAP PNG_SIMPLEMIPMAPS
+
+ /* Transparency parameters */
+-#define PNG_CALLBACK -3 /* Call the callback function to generate alpha */
++#define PNG_CALLBACK_FUNC -3 /* Call the callback function to generate alpha */
+ #define PNG_ALPHA -2 /* Use alpha channel in PNG file, if there is one */
+ #define PNG_SOLID -1 /* No transparency */
+ #define PNG_STENCIL 0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise */
+diff -up libglpng-1.45.orig/src/glpng.c~ libglpng-1.45.orig/src/glpng.c
+--- libglpng-1.45.orig/src/glpng.c~ 2011-12-06 19:38:53.000000000 +0100
++++ libglpng-1.45.orig/src/glpng.c 2011-12-06 22:13:34.501354149 +0100
+@@ -282,7 +282,11 @@ int APIENTRY pngLoadRawF(FILE *fp, pngRa
+ if (!endinfo) return 0;
+
+ // DH: added following lines
++#if PNG_LIBPNG_VER >= 10400
++ if (setjmp(png_jmpbuf(png)))
++#else
+ if (setjmp(png->jmpbuf))
++#endif
+ {
+ error:
+ png_destroy_read_struct(&png, &info, &endinfo);
+@@ -402,7 +406,11 @@ int APIENTRY pngLoadF(FILE *fp, int mipm
+ if (!endinfo) return 0;
+
+ // DH: added following lines
++#if PNG_LIBPNG_VER >= 10400
++ if (setjmp(png_jmpbuf(png)))
++#else
+ if (setjmp(png->jmpbuf))
++#endif
+ {
+ error:
+ png_destroy_read_struct(&png, &info, &endinfo);
+@@ -603,7 +611,7 @@ error:
+ #define ALPHA *q
+
+ switch (trans) {
+- case PNG_CALLBACK:
++ case PNG_CALLBACK_FUNC:
+ FORSTART
+ ALPHA = AlphaCallback((unsigned char) r, (unsigned char) g, (unsigned char) b);
+ FOREND