# HG changeset patch # User Thien-Thi Nguyen # Date 1189110452 0 # Node ID 8090732dfc6d4f4eb350245fd4edc8ba447ad0e9 # Parent 853738fb50ecf116c952e38596cb475a7def594d (gif_load): Fix bug: Handle nonexistent colormap. diff -r 853738fb50ec -r 8090732dfc6d src/image.c --- a/src/image.c Thu Sep 06 07:01:41 2007 +0000 +++ b/src/image.c Thu Sep 06 20:27:32 2007 +0000 @@ -7878,13 +7878,14 @@ 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);