Line
Link Here
|
0 |
-- a/src/modules/loaders/loader_gif.c |
0 |
++ b/src/modules/loaders/loader_gif.c |
Lines 60-72
Link Here
|
60 |
h = gif->Image.Height; |
60 |
h = gif->Image.Height; |
61 |
if (!IMAGE_DIMENSIONS_OK(w, h)) |
61 |
if (!IMAGE_DIMENSIONS_OK(w, h)) |
62 |
{ |
62 |
{ |
63 |
DGifCloseFile(gif); |
63 |
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) |
|
|
64 |
DGifCloseFile(gif, NULL); |
65 |
#else |
66 |
DGifCloseFile(gif); |
67 |
#endif |
64 |
return 0; |
68 |
return 0; |
65 |
} |
69 |
} |
66 |
rows = malloc(h * sizeof(GifRowType *)); |
70 |
rows = malloc(h * sizeof(GifRowType *)); |
67 |
if (!rows) |
71 |
if (!rows) |
68 |
{ |
72 |
{ |
69 |
DGifCloseFile(gif); |
73 |
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) |
|
|
74 |
DGifCloseFile(gif, NULL); |
75 |
#else |
76 |
DGifCloseFile(gif); |
77 |
#endif |
70 |
return 0; |
78 |
return 0; |
71 |
} |
79 |
} |
72 |
for (i = 0; i < h; i++) |
80 |
for (i = 0; i < h; i++) |
Lines 78-84
Link Here
|
78 |
rows[i] = malloc(w * sizeof(GifPixelType)); |
86 |
rows[i] = malloc(w * sizeof(GifPixelType)); |
79 |
if (!rows[i]) |
87 |
if (!rows[i]) |
80 |
{ |
88 |
{ |
81 |
DGifCloseFile(gif); |
89 |
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) |
|
|
90 |
DGifCloseFile(gif, NULL); |
91 |
#else |
92 |
DGifCloseFile(gif); |
93 |
#endif |
82 |
for (i = 0; i < h; i++) |
94 |
for (i = 0; i < h; i++) |
83 |
{ |
95 |
{ |
84 |
if (rows[i]) |
96 |
if (rows[i]) |
Lines 150-156
Link Here
|
150 |
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h); |
162 |
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h); |
151 |
if (!im->data) |
163 |
if (!im->data) |
152 |
{ |
164 |
{ |
153 |
DGifCloseFile(gif); |
165 |
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) |
|
|
166 |
DGifCloseFile(gif, NULL); |
167 |
#else |
168 |
DGifCloseFile(gif); |
169 |
#endif |
154 |
free(rows); |
170 |
free(rows); |
155 |
return 0; |
171 |
return 0; |
156 |
} |
172 |
} |
Lines 181-187
Link Here
|
181 |
last_per = (int)per; |
197 |
last_per = (int)per; |
182 |
if (!(progress(im, (int)per, 0, last_y, w, i))) |
198 |
if (!(progress(im, (int)per, 0, last_y, w, i))) |
183 |
{ |
199 |
{ |
184 |
DGifCloseFile(gif); |
200 |
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) |
|
|
201 |
DGifCloseFile(gif, NULL); |
202 |
#else |
203 |
DGifCloseFile(gif); |
204 |
#endif |
185 |
for (i = 0; i < h; i++) |
205 |
for (i = 0; i < h; i++) |
186 |
{ |
206 |
{ |
187 |
free(rows[i]); |
207 |
free(rows[i]); |
Lines 198-204
Link Here
|
198 |
{ |
218 |
{ |
199 |
progress(im, 100, 0, last_y, w, h); |
219 |
progress(im, 100, 0, last_y, w, h); |
200 |
} |
220 |
} |
201 |
DGifCloseFile(gif); |
221 |
#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) |
|
|
222 |
DGifCloseFile(gif, NULL); |
223 |
#else |
224 |
DGifCloseFile(gif); |
225 |
#endif |
202 |
for (i = 0; i < h; i++) |
226 |
for (i = 0; i < h; i++) |
203 |
{ |
227 |
{ |
204 |
free(rows[i]); |
228 |
free(rows[i]); |