1 |
jer 14/11/27 01:53:32 |
2 |
|
3 |
Added: fbida-2.09-giflib.patch |
4 |
Log: |
5 |
Use a single patch for every giflib version. |
6 |
|
7 |
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key A792A613) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-gfx/fbida/files/fbida-2.09-giflib.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/fbida/files/fbida-2.09-giflib.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/fbida/files/fbida-2.09-giflib.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: fbida-2.09-giflib.patch |
16 |
=================================================================== |
17 |
--- a/rd/read-gif.c |
18 |
+++ b/rd/read-gif.c |
19 |
@@ -25,7 +25,13 @@ |
20 |
if (GIF_ERROR == DGifGetRecordType(h->gif,&RecordType)) { |
21 |
if (debug) |
22 |
fprintf(stderr,"gif: DGifGetRecordType failed\n"); |
23 |
- PrintGifError(); |
24 |
+#if GIFLIB_MAJOR >= 5 |
25 |
+ GifErrorString(D_GIF_ERR_NOT_GIF_FILE); |
26 |
+#elif (GIFLIB_MAJOR >= 4 && GIFLIB_MINOR >=2) |
27 |
+ GifErrorString(); |
28 |
+#else |
29 |
+ PrintGifError(); |
30 |
+#endif |
31 |
return -1; |
32 |
} |
33 |
switch (RecordType) { |
34 |
@@ -42,7 +48,13 @@ |
35 |
if (rc == GIF_ERROR) { |
36 |
if (debug) |
37 |
fprintf(stderr,"gif: DGifGetExtension failed\n"); |
38 |
+#if GIFLIB_MAJOR >= 5 |
39 |
+ GifErrorString(D_GIF_ERR_NOT_GIF_FILE); |
40 |
+#elif (GIFLIB_MAJOR >= 4 && GIFLIB_MINOR >=2) |
41 |
+ GifErrorString(); |
42 |
+#else |
43 |
PrintGifError(); |
44 |
+#endif |
45 |
return -1; |
46 |
} |
47 |
if (debug) { |
48 |
@@ -93,12 +105,19 @@ |
49 |
struct gif_state *h; |
50 |
GifRecordType RecordType; |
51 |
int i, image = 0; |
52 |
+#if (GIFLIB_MAJOR >=5 && GIFLIB_MINOR >= 1) |
53 |
+ int ErrorCode; |
54 |
+#endif |
55 |
|
56 |
h = malloc(sizeof(*h)); |
57 |
memset(h,0,sizeof(*h)); |
58 |
|
59 |
h->infile = fp; |
60 |
+#if GIFLIB_MAJOR >= 5 |
61 |
+ h->gif = DGifOpenFileHandle(fileno(fp), NULL); |
62 |
+#else |
63 |
h->gif = DGifOpenFileHandle(fileno(fp)); |
64 |
+#endif |
65 |
h->row = malloc(h->gif->SWidth * sizeof(GifPixelType)); |
66 |
|
67 |
while (0 == image) { |
68 |
@@ -108,7 +127,15 @@ |
69 |
if (GIF_ERROR == DGifGetImageDesc(h->gif)) { |
70 |
if (debug) |
71 |
fprintf(stderr,"gif: DGifGetImageDesc failed\n"); |
72 |
+#if (GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1) |
73 |
+ GifErrorString(D_GIF_ERR_NO_IMAG_DSCR); |
74 |
+#elif GIFLIB_MAJOR >= 5 |
75 |
+ GifErrorString(NULL); |
76 |
+#elif (GIFLIB_MAJOR >= 4 && GIFLIB_MINOR >=2) |
77 |
+ GifErrorString(); |
78 |
+#else |
79 |
PrintGifError(); |
80 |
+#endif |
81 |
} |
82 |
if (NULL == h->gif->SColorMap && |
83 |
NULL == h->gif->Image.ColorMap) { |
84 |
@@ -156,7 +183,11 @@ |
85 |
oops: |
86 |
if (debug) |
87 |
fprintf(stderr,"gif: fatal error, aborting\n"); |
88 |
+#if (GIFLIB_MAJOR >=5 && GIFLIB_MINOR >= 1) |
89 |
+ DGifCloseFile(h->gif, &ErrorCode); |
90 |
+#else |
91 |
DGifCloseFile(h->gif); |
92 |
+#endif |
93 |
fclose(h->infile); |
94 |
free(h->row); |
95 |
free(h); |
96 |
@@ -193,10 +224,17 @@ |
97 |
gif_done(void *data) |
98 |
{ |
99 |
struct gif_state *h = data; |
100 |
+#if (GIFLIB_MAJOR >=5 && GIFLIB_MINOR >= 1) |
101 |
+ int ErrorCode; |
102 |
+#endif |
103 |
|
104 |
if (debug) |
105 |
fprintf(stderr,"gif: done, cleaning up\n"); |
106 |
+#if (GIFLIB_MAJOR >=5 && GIFLIB_MINOR >= 1) |
107 |
+ DGifCloseFile(h->gif, &ErrorCode); |
108 |
+#else |
109 |
DGifCloseFile(h->gif); |
110 |
+#endif |
111 |
fclose(h->infile); |
112 |
if (h->il) |
113 |
free(h->il); |