Adam -
Thanks for digging in on this. You're not entirely by yourself - I
tried out your killer gif on my cygwin Windows build, and
unsurprisingly, XEmacs crashed immediately.
On Fri, Aug 20, 2010 at 4:56 AM, Adam Sjøgren <asjo(a)koldfront.dk> wrote:
(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 much prefer this version of the fix. :-)
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.
I'll try this out by Sunday or Monday if no one else gets to this first.
Regards,
Vin
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta