summaryrefslogtreecommitdiff
path: root/community/swftools/giflib-5.0.patch
blob: 48263c6f3b6329d158a38a93fbffdb8a8b3dd4ca (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
diff -rupN a/src/gif2swf.c b/src/gif2swf.c
--- a/src/gif2swf.c	2011-01-02 03:30:29.000000000 +0000
+++ b/src/gif2swf.c	2013-07-30 19:30:32.666103403 +0000
@@ -65,6 +65,15 @@ enum disposal_method {
     RESTORE_TO_PREVIOUS
 };
 
+static void PrintGifError(int err)
+{
+  char *Err = GifErrorString(err);
+
+  if (Err != NULL)
+    fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
+  else
+    fprintf(stderr, "\nGIF-LIB undefined error %d.\n", err);
+}
 
 void SetFrameAction(TAG ** t, const char *src, int ver)
 {
@@ -230,13 +239,13 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, c
     }
     fclose(fi);
 
-    if ((gft = DGifOpenFileName(sname)) == NULL) {
+    if ((gft = DGifOpenFileName(sname, NULL)) == NULL) {
         fprintf(stderr, "%s is not a GIF file!\n", sname);
         return t;
     }
 
     if (DGifSlurp(gft) != GIF_OK) {
-        PrintGifError();
+        PrintGifError(DGifSlurp(gft));
         return t;
     }
 
@@ -488,7 +497,7 @@ int CheckInputFile(char *fname, char **r
     }
     fclose(fi);
 
-    if ((gft = DGifOpenFileName(s)) == NULL) {
+    if ((gft = DGifOpenFileName(s, NULL)) == NULL) {
         fprintf(stderr, "%s is not a GIF file!\n", fname);
         return -1;
     }
@@ -499,7 +508,7 @@ int CheckInputFile(char *fname, char **r
         global.max_image_height = gft->SHeight;
 
     if (DGifSlurp(gft) != GIF_OK) { 
-        PrintGifError();
+        PrintGifError(DGifSlurp(gft));
         return -1;
     }
     // After DGifSlurp() call, gft->ImageCount become available