aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen2007-09-06 20:25:18 +0000
committerThien-Thi Nguyen2007-09-06 20:25:18 +0000
commit1ab2cd4392b4a8bb2944cd4df13aa78007b0a4a8 (patch)
tree1872486fd4b8617c2758e49f2ab6834d549aa624
parent12451866c75e053089ee0fdde157cf45e9cce03e (diff)
downloademacs-1ab2cd4392b4a8bb2944cd4df13aa78007b0a4a8.tar.gz
emacs-1ab2cd4392b4a8bb2944cd4df13aa78007b0a4a8.zip
(gif_load): Fix bug: Handle nonexistent colormap.
-rw-r--r--src/ChangeLog4
-rw-r--r--src/image.c15
2 files changed, 12 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d87df8d57cd..86d84bb780c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12007-09-06 Pixel <pixel@mandriva.com> (tiny change)
2
3 * image.c (gif_load): Fix bug: Handle nonexistent colormap.
4
12007-09-06 Glenn Morris <rgm@gnu.org> 52007-09-06 Glenn Morris <rgm@gnu.org>
2 6
3 * gtkutil.c (menu_grab_callback) <cnt>: 7 * gtkutil.c (menu_grab_callback) <cnt>:
diff --git a/src/image.c b/src/image.c
index 7a258df5a3b..b330ab38931 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7886,13 +7886,14 @@ gif_load (f, img)
7886 init_color_table (); 7886 init_color_table ();
7887 bzero (pixel_colors, sizeof pixel_colors); 7887 bzero (pixel_colors, sizeof pixel_colors);
7888 7888
7889 for (i = 0; i < gif_color_map->ColorCount; ++i) 7889 if (gif_color_map)
7890 { 7890 for (i = 0; i < gif_color_map->ColorCount; ++i)
7891 int r = gif_color_map->Colors[i].Red << 8; 7891 {
7892 int g = gif_color_map->Colors[i].Green << 8; 7892 int r = gif_color_map->Colors[i].Red << 8;
7893 int b = gif_color_map->Colors[i].Blue << 8; 7893 int g = gif_color_map->Colors[i].Green << 8;
7894 pixel_colors[i] = lookup_rgb_color (f, r, g, b); 7894 int b = gif_color_map->Colors[i].Blue << 8;
7895 } 7895 pixel_colors[i] = lookup_rgb_color (f, r, g, b);
7896 }
7896 7897
7897#ifdef COLOR_TABLE_SUPPORT 7898#ifdef COLOR_TABLE_SUPPORT
7898 img->colors = colors_in_color_table (&img->ncolors); 7899 img->colors = colors_in_color_table (&img->ncolors);