summaryrefslogtreecommitdiff
blob: f36b6b41fcc237f9135fd7ffaa4550e0575115ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
http://sourceforge.net/tracker/index.php?func=detail&aid=1829712&group_id=102202&atid=631304

--- giflib/util/gif2rle.c
+++ giflib/util/gif2rle.c
@@ -222,11 +222,8 @@
     ColorMap = (GifFile->Image.ColorMap ?
                     GifFile->Image.ColorMap->Colors :
                     GifFile->SColorMap->Colors);
-    if (ColorMap == NULL) {
-        fprintf(stderr, "Gif Image does not have a colormap\n");
-        exit(EXIT_FAILURE);
-    }
-    ColorMapSize = 1 << ColorMap->BitsPerPixel;
+    ColorMapSize = 1 << (GifFile->Image.ColorMap ? GifFile->Image.ColorMap->BitsPerPixel :
+				                GifFile->SColorMap->BitsPerPixel);
     DumpScreen2Rle(ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
 
     if (DGifCloseFile(GifFile) == GIF_ERROR) {