summaryrefslogtreecommitdiff
path: root/graphics/ida/files/patch-rd__read-gif.c
blob: e5f204c4c9b2226c1d2f9941589c3e0790a5dcc0 (plain) (blame)
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
--- rd/read-gif.c.orig	2012-02-23 02:13:36.000000000 +0900
+++ rd/read-gif.c	2012-09-10 18:52:32.000000000 +0900
@@ -13,6 +13,17 @@
     int w,h;
 };
 
+static void
+localPrintGifError(void)
+{
+    char *Err = GifErrorString();
+
+    if (Err != NULL)
+	fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
+    else
+	fprintf(stderr, "\nGIF-LIB undefined error %d.\n", GifError());
+}
+
 static GifRecordType
 gif_fileread(struct gif_state *h)
 {
@@ -25,7 +36,7 @@
 	if (GIF_ERROR == DGifGetRecordType(h->gif,&RecordType)) {
 	    if (debug)
 		fprintf(stderr,"gif: DGifGetRecordType failed\n");
-	    PrintGifError();
+	    localPrintGifError();
 	    return -1;
 	}
 	switch (RecordType) {
@@ -42,7 +53,7 @@
 		if (rc == GIF_ERROR) {
 		    if (debug)
 			fprintf(stderr,"gif: DGifGetExtension failed\n");
-		    PrintGifError();
+		    localPrintGifError();
 		    return -1;
 		}
 		if (debug) {
@@ -108,7 +119,7 @@
 	    if (GIF_ERROR == DGifGetImageDesc(h->gif)) {
 		if (debug)
 		    fprintf(stderr,"gif: DGifGetImageDesc failed\n");
-		PrintGifError();
+		localPrintGifError();
 	    }
 	    if (NULL == h->gif->SColorMap &&
 		NULL == h->gif->Image.ColorMap) {