diff src/glyphs-eimage.c @ 5250:db84c9d41437

Apply GIF colormap fix from Adam Sjogren for issues 150 and 713
author Vin Shelton <acs@xemacs.org>
date Thu, 26 Aug 2010 22:45:58 -0400
parents 97eb4942aec8
children 6c3a695f54f5 308d34e9f07d
line wrap: on
line diff
--- a/src/glyphs-eimage.c	Fri Aug 20 13:04:54 2010 +0200
+++ b/src/glyphs-eimage.c	Thu Aug 26 22:45:58 2010 -0400
@@ -694,7 +694,7 @@
 
   /* 3. Now create the EImage(s) */
   {
-    ColorMapObject *cmo = unwind.giffile->SColorMap;
+    ColorMapObject *cmo = (unwind.giffile->Image.ColorMap ? unwind.giffile->Image.ColorMap : unwind.giffile->SColorMap);
     int i, j, row, pass, interlace, slice;
     UINT_64_BIT pixels_sq;
     Binbyte *eip;
@@ -703,6 +703,9 @@
     static int InterlacedOffset[] = { 0, 4, 2, 1 };
     static int InterlacedJumps[] = { 8, 8, 4, 2 };
 
+    if (cmo == NULL)
+      signal_image_error ("GIF image has no color map", instantiator);
+
     height = unwind.giffile->SHeight;
     width = unwind.giffile->SWidth;
     pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;