diff options
Diffstat (limited to 'media-libs/imlib/files')
6 files changed, 250 insertions, 12 deletions
diff --git a/media-libs/imlib/files/imlib-1.9.15-asneeded.patch b/media-libs/imlib/files/imlib-1.9.15-asneeded.patch index 3b7dd8a8bbca..d9ccde7bdfcd 100644 --- a/media-libs/imlib/files/imlib-1.9.15-asneeded.patch +++ b/media-libs/imlib/files/imlib-1.9.15-asneeded.patch @@ -4,8 +4,8 @@ an error... Adding include is necessary for gcc-4.3. ---- configure.in 2008-07-16 09:18:35 +0000 -+++ configure.in 2008-07-16 09:18:43 +0000 +--- a/configure.in 2008-07-16 09:18:35 +0000 ++++ b/configure.in 2008-07-16 09:18:43 +0000 @@ -61,6 +61,7 @@ AC_TRY_RUN([ #include <glib.h> diff --git a/media-libs/imlib/files/imlib-1.9.15-bpp16-CVE-2007-3568.patch b/media-libs/imlib/files/imlib-1.9.15-bpp16-CVE-2007-3568.patch index 94595ffdf55a..308f9abc044d 100644 --- a/media-libs/imlib/files/imlib-1.9.15-bpp16-CVE-2007-3568.patch +++ b/media-libs/imlib/files/imlib-1.9.15-bpp16-CVE-2007-3568.patch @@ -1,5 +1,5 @@ ---- Imlib/load.c.orig 2007-08-13 23:06:20.000000000 -0300 -+++ Imlib/load.c 2007-08-13 23:06:51.000000000 -0300 +--- a/Imlib/load.c.orig 2007-08-13 23:06:20.000000000 -0300 ++++ b/Imlib/load.c 2007-08-13 23:06:51.000000000 -0300 @@ -645,7 +645,7 @@ planes = (int)word; fread(&word, 2, 1, file); diff --git a/media-libs/imlib/files/imlib-1.9.15-giflib51-1.patch b/media-libs/imlib/files/imlib-1.9.15-giflib51-1.patch new file mode 100644 index 000000000000..d0e3ac7d8d2c --- /dev/null +++ b/media-libs/imlib/files/imlib-1.9.15-giflib51-1.patch @@ -0,0 +1,122 @@ +diff -Nru imlib-1.9.15.old/gdk_imlib/io-gif.c imlib-1.9.15/gdk_imlib/io-gif.c +--- imlib-1.9.15.old/gdk_imlib/io-gif.c 2014-05-28 13:54:48.860293627 +0100 ++++ imlib-1.9.15/gdk_imlib/io-gif.c 2014-05-28 13:58:29.992185729 +0100 +@@ -1,8 +1,10 @@ + #include <config.h> + #include "gdk_imlib.h" + #include "gdk_imlib_private.h" ++#include <gifutil.h> + + #ifndef HAVE_LIBGIF ++/*------------------------*/ + unsigned char loader_gif (FILE *f, int *w, int *h, int *t) + { + return NULL; +@@ -43,14 +45,14 @@ + { + if (DGifGetRecordType(gif, &rec) == GIF_ERROR) + { +- PrintGifError(); ++ _PrintGifError(gif); + rec = TERMINATE_RECORD_TYPE; + } + if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done)) + { + if (DGifGetImageDesc(gif) == GIF_ERROR) + { +- PrintGifError(); ++ _PrintGifError(gif); + rec = TERMINATE_RECORD_TYPE; + } + *w = gif->Image.Width; +diff -Nru imlib-1.9.15.old/gifutil.h imlib-1.9.15/gifutil.h +--- imlib-1.9.15.old/gifutil.h 1970-01-01 01:00:00.000000000 +0100 ++++ imlib-1.9.15/gifutil.h 2014-05-28 13:57:45.019424755 +0100 +@@ -0,0 +1,26 @@ ++#ifndef __GIFUTIL_H__ ++#define __GIFUTIL_H__ ++ ++static void ++_PrintGifError(GifFileType *gif) ++{ ++ /* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ ++ /* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ ++#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ ++ ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) ++ /* Static string actually, hence the const char* cast */ ++ ++#if GIFLIB_MAJOR >= 5 ++ const char* gifliberr = (const char*) GifErrorString(gif->Error); ++#else ++ const char* gifliberr = (const char*) GifErrorString(); ++#endif ++ if (gifliberr == NULL) ++ gifliberr = "Unknown error"; ++ fprintf(stderr, "%s\n", gifliberr); ++#else ++ PrintGifError(); ++#endif ++} ++ ++#endif +diff -Nru imlib-1.9.15.old/Imlib/load.c imlib-1.9.15/Imlib/load.c +--- imlib-1.9.15.old/Imlib/load.c 2014-05-28 13:54:49.008295568 +0100 ++++ imlib-1.9.15/Imlib/load.c 2014-05-28 14:00:21.321983945 +0100 +@@ -3,6 +3,7 @@ + #include "Imlib.h" + #include "Imlib_private.h" + #include <setjmp.h> ++#include <gifutil.h> + + #define G_MAXINT ((int) 0x7fffffff) + +@@ -431,6 +432,8 @@ + #endif /* HAVE_LIBTIFF */ + + #ifdef HAVE_LIBGIF ++/*------------------------*/ ++/*------------------------*/ + unsigned char * + _LoadGIF(ImlibData * id, FILE *f, int *w, int *h, int *t) + { +@@ -454,22 +457,38 @@ + fd = fileno(f); + /* Apparently rewind(f) isn't sufficient */ + lseek(fd, (long) 0, 0); ++ ++#if GIFLIB_MAJOR >= 5 ++ int errCode = 0; ++ ++ gif = DGifOpenFileHandle(fd, &errCode); ++ if (!gif) ++ { ++ const char* gifliberr = (const char*) GifErrorString(errCode); ++ if (gifliberr == NULL) ++ gifliberr = "Unknown error"; ++ fprintf(stderr, "%s\n", gifliberr); ++ return NULL; ++ } ++#else + gif = DGifOpenFileHandle(fd); + + if (!gif) + return NULL; ++#endif ++ + do + { + if (DGifGetRecordType(gif, &rec) == GIF_ERROR) + { +- PrintGifError(); ++ _PrintGifError(gif); + rec = TERMINATE_RECORD_TYPE; + } + if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done)) + { + if (DGifGetImageDesc(gif) == GIF_ERROR) + { +- PrintGifError(); ++ _PrintGifError(gif); + rec = TERMINATE_RECORD_TYPE; + } + *w = gif->Image.Width; diff --git a/media-libs/imlib/files/imlib-1.9.15-giflib51-2.patch b/media-libs/imlib/files/imlib-1.9.15-giflib51-2.patch new file mode 100644 index 000000000000..7911e7c7e40d --- /dev/null +++ b/media-libs/imlib/files/imlib-1.9.15-giflib51-2.patch @@ -0,0 +1,107 @@ +diff -Nru imlib-1.9.15.old/gifutil.h imlib-1.9.15/gifutil.h +--- imlib-1.9.15.old/gifutil.h 2015-02-03 00:53:09.742075193 +0000 ++++ imlib-1.9.15/gifutil.h 2015-02-05 19:24:09.848783163 +0000 +@@ -2,7 +2,7 @@ + #define __GIFUTIL_H__ + + static void +-_PrintGifError(GifFileType *gif) ++_PrintGifError(int errorCode) + { + /* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ + /* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ +@@ -11,7 +11,7 @@ + /* Static string actually, hence the const char* cast */ + + #if GIFLIB_MAJOR >= 5 +- const char* gifliberr = (const char*) GifErrorString(gif->Error); ++ const char* gifliberr = (const char*) GifErrorString(errorCode); + #else + const char* gifliberr = (const char*) GifErrorString(); + #endif +diff -Nru imlib-1.9.15.old/Imlib/load.c imlib-1.9.15/Imlib/load.c +--- imlib-1.9.15.old/Imlib/load.c 2015-02-03 00:53:09.742075193 +0000 ++++ imlib-1.9.15/Imlib/load.c 2015-02-05 19:30:12.847147998 +0000 +@@ -434,6 +434,19 @@ + #ifdef HAVE_LIBGIF + /*------------------------*/ + /*------------------------*/ ++void ++_CloseGIF(GifFileType *gif) ++{ ++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) ++ int errCode = 0; ++ ++ if (DGifCloseFile(gif, &errCode) != GIF_OK) ++ _PrintGifError(errCode); ++#else ++ DGifCloseFile(gif); ++#endif ++} ++ + unsigned char * + _LoadGIF(ImlibData * id, FILE *f, int *w, int *h, int *t) + { +@@ -464,10 +477,7 @@ + gif = DGifOpenFileHandle(fd, &errCode); + if (!gif) + { +- const char* gifliberr = (const char*) GifErrorString(errCode); +- if (gifliberr == NULL) +- gifliberr = "Unknown error"; +- fprintf(stderr, "%s\n", gifliberr); ++ _PrintGifError(errCode); + return NULL; + } + #else +@@ -481,14 +491,14 @@ + { + if (DGifGetRecordType(gif, &rec) == GIF_ERROR) + { +- _PrintGifError(gif); ++ _PrintGifError(gif->Error); + rec = TERMINATE_RECORD_TYPE; + } + if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done)) + { + if (DGifGetImageDesc(gif) == GIF_ERROR) + { +- _PrintGifError(gif); ++ _PrintGifError(gif->Error); + rec = TERMINATE_RECORD_TYPE; + } + *w = gif->Image.Width; +@@ -500,13 +510,13 @@ + rows = malloc(*h * sizeof(GifRowType *)); + if (!rows) + { +- DGifCloseFile(gif); ++ _CloseGIF(gif); + return NULL; + } + data = _imlib_malloc_image(*w, *h); + if (!data) + { +- DGifCloseFile(gif); ++ _CloseGIF(gif); + free(rows); + return NULL; + } +@@ -517,7 +527,7 @@ + rows[i] = malloc(*w * sizeof(GifPixelType)); + if (!rows[i]) + { +- DGifCloseFile(gif); ++ _CloseGIF(gif); + for (i = 0; i < *h; i++) + if (rows[i]) + free(rows[i]); +@@ -606,7 +616,7 @@ + } + } + } +- DGifCloseFile(gif); ++ _CloseGIF(gif); + for (i = 0; i < *h; i++) + free(rows[i]); + free(rows); diff --git a/media-libs/imlib/files/imlib-1.9.15-libpng15.patch b/media-libs/imlib/files/imlib-1.9.15-libpng15.patch index 7837cd488cf2..353960897f1c 100644 --- a/media-libs/imlib/files/imlib-1.9.15-libpng15.patch +++ b/media-libs/imlib/files/imlib-1.9.15-libpng15.patch @@ -1,5 +1,5 @@ ---- gdk_imlib/io-png.c -+++ gdk_imlib/io-png.c +--- a/gdk_imlib/io-png.c ++++ b/gdk_imlib/io-png.c @@ -40,13 +40,13 @@ return NULL; } @@ -67,8 +67,8 @@ { fclose(f); png_destroy_write_struct(&png_ptr, (png_infopp) NULL); ---- Imlib/load.c -+++ Imlib/load.c +--- a/Imlib/load.c ++++ b/Imlib/load.c @@ -197,12 +197,12 @@ png_destroy_read_struct(&png_ptr, NULL, NULL); return NULL; @@ -110,8 +110,8 @@ else { for (y = 0; y < *h; y++) ---- Imlib/save.c -+++ Imlib/save.c +--- a/Imlib/save.c ++++ b/Imlib/save.c @@ -342,7 +342,7 @@ png_destroy_write_struct(&png_ptr, (png_infopp) NULL); return 0; @@ -121,8 +121,8 @@ { fclose(f); png_destroy_write_struct(&png_ptr, (png_infopp) NULL); ---- Imlib/utils.c -+++ Imlib/utils.c +--- a/Imlib/utils.c ++++ b/Imlib/utils.c @@ -1981,14 +1981,13 @@ png_destroy_read_struct(&png_ptr, NULL, NULL); return NULL; diff --git a/media-libs/imlib/files/imlib-1.9.15-linking.patch b/media-libs/imlib/files/imlib-1.9.15-linking.patch new file mode 100644 index 000000000000..a00b089f4126 --- /dev/null +++ b/media-libs/imlib/files/imlib-1.9.15-linking.patch @@ -0,0 +1,9 @@ +gentoo bug #499268 +--- a/Imlib/Makefile.am ++++ b/Imlib/Makefile.am +@@ -43,4 +43,4 @@ + + check_PROGRAMS = t-load + +-t_load_LDADD = libImlib.la ++t_load_LDADD = libImlib.la -lX11 |