summaryrefslogtreecommitdiffstats
path: root/freebsd/dependencies/imlib/files/patch-giflib5.1.diff
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/dependencies/imlib/files/patch-giflib5.1.diff')
-rw-r--r--freebsd/dependencies/imlib/files/patch-giflib5.1.diff50
1 files changed, 50 insertions, 0 deletions
diff --git a/freebsd/dependencies/imlib/files/patch-giflib5.1.diff b/freebsd/dependencies/imlib/files/patch-giflib5.1.diff
new file mode 100644
index 000000000..fddd984fc
--- /dev/null
+++ b/freebsd/dependencies/imlib/files/patch-giflib5.1.diff
@@ -0,0 +1,50 @@
+Index: imlib-1.9.15/Imlib/load.c
+===================================================================
+--- imlib-1.9.15.orig/Imlib/load.c
++++ imlib-1.9.15/Imlib/load.c
+@@ -489,13 +489,21 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
+ rows = malloc(*h * sizeof(GifRowType *));
+ if (!rows)
+ {
++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ return NULL;
+ }
+ data = _imlib_malloc_image(*w, *h);
+ if (!data)
+ {
++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ free(rows);
+ return NULL;
+ }
+@@ -506,7 +514,11 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
+ rows[i] = malloc(*w * sizeof(GifPixelType));
+ if (!rows[i])
+ {
++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ for (i = 0; i < *h; i++)
+ if (rows[i])
+ free(rows[i]);
+@@ -595,7 +607,11 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
+ }
+ }
+ }
++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ for (i = 0; i < *h; i++)
+ free(rows[i]);
+ free(rows);