# HG changeset patch # User Vin Shelton # Date 1282877158 14400 # Node ID db84c9d414379682e39b363f652c3b19f150936a # Parent d4fae3ebf26a2e143f1d04308834cc6f2fd8ffb5 Apply GIF colormap fix from Adam Sjogren for issues 150 and 713 diff -r d4fae3ebf26a -r db84c9d41437 src/ChangeLog --- a/src/ChangeLog Fri Aug 20 13:04:54 2010 +0200 +++ b/src/ChangeLog Thu Aug 26 22:45:58 2010 -0400 @@ -1,3 +1,9 @@ +2010-08-26 Adam Sjøgren + + * glyphs-eimage.c (gif_instantiate): Try harder to find an + appropriate GIF colormap and then flag an error if one can't be + found. + 2010-08-21 Aidan Kehoe * lread.c (read_escape): diff -r d4fae3ebf26a -r db84c9d41437 src/glyphs-eimage.c --- 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;