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
|
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);
|