]> git.pld-linux.org Git - packages/fbida.git/blob - fbida-giflib.patch
- fixed giflib patch; release 12
[packages/fbida.git] / fbida-giflib.patch
1 diff -Naur fbida-2.09-orig/rd/read-gif.c fbida-2.09/rd/read-gif.c
2 --- fbida-2.09-orig/rd/read-gif.c       2013-07-29 16:43:26.949362012 -0400
3 +++ fbida-2.09/rd/read-gif.c    2013-07-29 16:43:43.669166969 -0400
4 @@ -13,6 +13,13 @@
5      int w,h;
6  };
7  
8 +static void
9 +localPrintGifError(int ErrorCode)
10 +{
11 +    const char *err = GifErrorString(ErrorCode);
12 +    fprintf(stderr, "\nGIF-LIB error %d: %s.\n", ErrorCode, err);
13 +}
14 +
15  static GifRecordType
16  gif_fileread(struct gif_state *h)
17  {
18 @@ -25,7 +33,7 @@
19         if (GIF_ERROR == DGifGetRecordType(h->gif,&RecordType)) {
20             if (debug)
21                 fprintf(stderr,"gif: DGifGetRecordType failed\n");
22 -           PrintGifError();
23 +           localPrintGifError(h->gif->Error);
24             return -1;
25         }
26         switch (RecordType) {
27 @@ -42,7 +50,7 @@
28                 if (rc == GIF_ERROR) {
29                     if (debug)
30                         fprintf(stderr,"gif: DGifGetExtension failed\n");
31 -                   PrintGifError();
32 +                   localPrintGifError(h->gif->Error);
33                     return -1;
34                 }
35                 if (debug) {
36 @@ -93,12 +101,13 @@
37      struct gif_state *h;
38      GifRecordType RecordType;
39      int i, image = 0;
40 -    
41 +    int Error;
42 +
43      h = malloc(sizeof(*h));
44      memset(h,0,sizeof(*h));
45  
46      h->infile = fp;
47 -    h->gif = DGifOpenFileHandle(fileno(fp));
48 +    h->gif = DGifOpenFileHandle(fileno(fp), &Error);
49      h->row = malloc(h->gif->SWidth * sizeof(GifPixelType));
50  
51      while (0 == image) {
52 @@ -108,7 +117,7 @@
53             if (GIF_ERROR == DGifGetImageDesc(h->gif)) {
54                 if (debug)
55                     fprintf(stderr,"gif: DGifGetImageDesc failed\n");
56 -               PrintGifError();
57 +               localPrintGifError(h->gif->Error);
58             }
59             if (NULL == h->gif->SColorMap &&
60                 NULL == h->gif->Image.ColorMap) {
This page took 0.116394 seconds and 3 git commands to generate.