Removed
Link Here
|
1 |
--- src/modules/loaders/loader_gif.c.orig 2013-12-21 10:16:10 UTC |
2 |
+++ src/modules/loaders/loader_gif.c |
3 |
@@ -36,7 +36,11 @@ load(ImlibImage * im, ImlibProgressFunct |
4 |
#endif |
5 |
if (fd < 0) |
6 |
return 0; |
7 |
+#if GIFLIB_MAJOR >= 5 |
8 |
+ gif = DGifOpenFileHandle(fd, NULL); |
9 |
+#else |
10 |
gif = DGifOpenFileHandle(fd); |
11 |
+#endif |
12 |
if (!gif) |
13 |
{ |
14 |
close(fd); |
15 |
@@ -60,13 +64,21 @@ load(ImlibImage * im, ImlibProgressFunct |
16 |
h = gif->Image.Height; |
17 |
if (!IMAGE_DIMENSIONS_OK(w, h)) |
18 |
{ |
19 |
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 |
20 |
+ DGifCloseFile(gif, NULL); |
21 |
+#else |
22 |
DGifCloseFile(gif); |
23 |
+#endif |
24 |
return 0; |
25 |
} |
26 |
rows = malloc(h * sizeof(GifRowType *)); |
27 |
if (!rows) |
28 |
{ |
29 |
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 |
30 |
+ DGifCloseFile(gif, NULL); |
31 |
+#else |
32 |
DGifCloseFile(gif); |
33 |
+#endif |
34 |
return 0; |
35 |
} |
36 |
for (i = 0; i < h; i++) |
37 |
@@ -78,7 +90,11 @@ load(ImlibImage * im, ImlibProgressFunct |
38 |
rows[i] = malloc(w * sizeof(GifPixelType)); |
39 |
if (!rows[i]) |
40 |
{ |
41 |
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 |
42 |
+ DGifCloseFile(gif, NULL); |
43 |
+#else |
44 |
DGifCloseFile(gif); |
45 |
+#endif |
46 |
for (i = 0; i < h; i++) |
47 |
{ |
48 |
if (rows[i]) |
49 |
@@ -150,7 +166,11 @@ load(ImlibImage * im, ImlibProgressFunct |
50 |
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h); |
51 |
if (!im->data) |
52 |
{ |
53 |
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 |
54 |
+ DGifCloseFile(gif, NULL); |
55 |
+#else |
56 |
DGifCloseFile(gif); |
57 |
+#endif |
58 |
free(rows); |
59 |
return 0; |
60 |
} |
61 |
@@ -181,7 +201,11 @@ load(ImlibImage * im, ImlibProgressFunct |
62 |
last_per = (int)per; |
63 |
if (!(progress(im, (int)per, 0, last_y, w, i))) |
64 |
{ |
65 |
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 |
66 |
+ DGifCloseFile(gif, NULL); |
67 |
+#else |
68 |
DGifCloseFile(gif); |
69 |
+#endif |
70 |
for (i = 0; i < h; i++) |
71 |
{ |
72 |
free(rows[i]); |
73 |
@@ -198,7 +222,11 @@ load(ImlibImage * im, ImlibProgressFunct |
74 |
{ |
75 |
progress(im, 100, 0, last_y, w, h); |
76 |
} |
77 |
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 |
78 |
+ DGifCloseFile(gif, NULL); |
79 |
+#else |
80 |
DGifCloseFile(gif); |
81 |
+#endif |
82 |
for (i = 0; i < h; i++) |
83 |
{ |
84 |
free(rows[i]); |