]> git.eshelyaron.com Git - emacs.git/commitdiff
(gif_load): Fix bug: Handle nonexistent colormap.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Thu, 6 Sep 2007 20:25:18 +0000 (20:25 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Thu, 6 Sep 2007 20:25:18 +0000 (20:25 +0000)
src/ChangeLog
src/image.c

index d87df8d57cd89c8b37dc916921cc3339e5ac5491..86d84bb780ce3cbfc78f51617e2218229266d6ee 100644 (file)
@@ -1,3 +1,7 @@
+2007-09-06  Pixel  <pixel@mandriva.com>  (tiny change)
+
+       * image.c (gif_load): Fix bug: Handle nonexistent colormap.
+
 2007-09-06  Glenn Morris  <rgm@gnu.org>
 
        * gtkutil.c (menu_grab_callback) <cnt>:
index 7a258df5a3b8e62ea6240cbc969b8dd8c6b74cd2..b330ab38931e4e330d5abb9ba7b5ee5570381c34 100644 (file)
@@ -7886,13 +7886,14 @@ gif_load (f, img)
   init_color_table ();
   bzero (pixel_colors, sizeof pixel_colors);
 
-  for (i = 0; i < gif_color_map->ColorCount; ++i)
-    {
-      int r = gif_color_map->Colors[i].Red << 8;
-      int g = gif_color_map->Colors[i].Green << 8;
-      int b = gif_color_map->Colors[i].Blue << 8;
-      pixel_colors[i] = lookup_rgb_color (f, r, g, b);
-    }
+  if (gif_color_map)
+    for (i = 0; i < gif_color_map->ColorCount; ++i)
+      {
+        int r = gif_color_map->Colors[i].Red << 8;
+        int g = gif_color_map->Colors[i].Green << 8;
+        int b = gif_color_map->Colors[i].Blue << 8;
+        pixel_colors[i] = lookup_rgb_color (f, r, g, b);
+      }
 
 #ifdef COLOR_TABLE_SUPPORT
   img->colors = colors_in_color_table (&img->ncolors);