summaryrefslogtreecommitdiffstats
path: root/arch/tde-deps/imlib/imlib-giflib51.patch
blob: ae0cf7043af056b0dc73d983eba0ed4c1ce539c1 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
diff -ruN imlib-1.9.15.orig/gdk_imlib/io-gif.c imlib-1.9.15/gdk_imlib/io-gif.c
--- imlib-1.9.15.orig/gdk_imlib/io-gif.c	2014-05-27 09:38:13.210527763 +0000
+++ imlib-1.9.15/gdk_imlib/io-gif.c	2014-05-27 09:43:55.435910398 +0000
@@ -30,7 +30,7 @@
   fd = fileno(f);
   /* Apparently rewind(f) isn't sufficient */
   lseek(fd, (long) 0, 0);
-  gif = DGifOpenFileHandle(fd);
+  gif = DGifOpenFileHandle(fd, NULL);
 
   transp = -1;
   data = NULL;
@@ -43,14 +43,14 @@
     {
       if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
 	{
-	  PrintGifError();
+	  fprintf(stderr, "giflib error: %s\n", GifErrorString(gif->Error));
 	  rec = TERMINATE_RECORD_TYPE;
 	}
       if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done))
 	{
 	  if (DGifGetImageDesc(gif) == GIF_ERROR)
 	    {
-	      PrintGifError();
+	      fprintf(stderr, "giflib error: %s\n", GifErrorString(gif->Error));
 	      rec = TERMINATE_RECORD_TYPE;
 	    }
 	  *w = gif->Image.Width;
@@ -62,13 +62,13 @@
 	  rows = malloc(*h * sizeof(GifRowType *));
 	  if (!rows)
 	    {
-	      DGifCloseFile(gif);
+	      DGifCloseFile(gif, NULL);
 	      return NULL;
 	    }
 	  data = _gdk_malloc_image(*w, *h);
 	  if (!data)
 	    {
-	      DGifCloseFile(gif);
+	      DGifCloseFile(gif, NULL);
 	      free(rows);
 	      return NULL;
 	    }
@@ -79,7 +79,7 @@
 	      rows[i] = malloc(*w * sizeof(GifPixelType));
 	      if (!rows[i])
 		{
-		  DGifCloseFile(gif);
+		  DGifCloseFile(gif, NULL);
 		  for (i = 0; i < *h; i++)
 		    if (rows[i])
 		      free(rows[i]);
@@ -168,7 +168,7 @@
 	    }
 	}
     }
-  DGifCloseFile(gif);
+  DGifCloseFile(gif, NULL);
   for (i = 0; i < *h; i++)
     free(rows[i]);
   free(rows);
diff -ruN imlib-1.9.15.orig/Imlib/load.c imlib-1.9.15/Imlib/load.c
--- imlib-1.9.15.orig/Imlib/load.c	2014-05-27 09:38:13.220527723 +0000
+++ imlib-1.9.15/Imlib/load.c	2014-05-27 09:45:25.775576104 +0000
@@ -454,7 +454,7 @@
   fd = fileno(f);
   /* Apparently rewind(f) isn't sufficient */
   lseek(fd, (long) 0, 0);
-  gif = DGifOpenFileHandle(fd);
+  gif = DGifOpenFileHandle(fd, NULL);
 
   if (!gif)
     return NULL;
@@ -462,14 +462,14 @@
     {
       if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
 	{
-	  PrintGifError();
+          fprintf(stderr, "Imlib ERROR: JPEG uses line buffers > 16. Cannot load.\n");
 	  rec = TERMINATE_RECORD_TYPE;
 	}
       if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done))
 	{
 	  if (DGifGetImageDesc(gif) == GIF_ERROR)
 	    {
-	      PrintGifError();
+              fprintf(stderr, "Imlib ERROR: JPEG uses line buffers > 16. Cannot load.\n");
 	      rec = TERMINATE_RECORD_TYPE;
 	    }
 	  *w = gif->Image.Width;
@@ -481,13 +481,13 @@
 	  rows = malloc(*h * sizeof(GifRowType *));
 	  if (!rows)
 	    {
-	      DGifCloseFile(gif);
+	      DGifCloseFile(gif, NULL);
 	      return NULL;
 	    }
 	  data = _imlib_malloc_image(*w, *h);
 	  if (!data)
 	    {
-	      DGifCloseFile(gif);
+	      DGifCloseFile(gif, NULL);
 	      free(rows);
 	      return NULL;
 	    }
@@ -498,7 +498,7 @@
 	      rows[i] = malloc(*w * sizeof(GifPixelType));
 	      if (!rows[i])
 		{
-		  DGifCloseFile(gif);
+		  DGifCloseFile(gif, NULL);
 		  for (i = 0; i < *h; i++)
 		    if (rows[i])
 		      free(rows[i]);
@@ -587,7 +587,7 @@
 	    }
 	}
     }
-  DGifCloseFile(gif);
+  DGifCloseFile(gif, NULL);
   for (i = 0; i < *h; i++)
     free(rows[i]);
   free(rows);