(Continuing talking to myself:)
I've checked how other code handles color maps when reading gifs
(specifically libimlib2-dev in Debian), and the following patch fixes
the problem I encountered and makes the logo.gif in Mike Kupfers issue
#713 show correctly (same as in Firefox):
diff -r 04811a268716 -r 2519c46c4b9b src/glyphs-eimage.c
--- a/src/glyphs-eimage.c Sun Aug 15 15:42:45 2010 +0100
+++ b/src/glyphs-eimage.c Fri Aug 20 10:49:12 2010 +0200
@@ -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;
I'm sure I haven't submitted this patch in the correct way, as I haven't
had the time (nor momentum) to look into patcher etc. I hope someone
will pick it up anyway.
The check that cmo is NULL might be superfluous (imlib2 doesn't check,
for instance), but not crashing when stuff goes wrong is also nice.
Best regards,
Adam
--
"My internal clock is on Tokyo time." Adam Sjøgren
asjo(a)koldfront.dk
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta