diff options
| author | Thien-Thi Nguyen | 2007-09-06 20:25:18 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2007-09-06 20:25:18 +0000 |
| commit | 1ab2cd4392b4a8bb2944cd4df13aa78007b0a4a8 (patch) | |
| tree | 1872486fd4b8617c2758e49f2ab6834d549aa624 /src/image.c | |
| parent | 12451866c75e053089ee0fdde157cf45e9cce03e (diff) | |
| download | emacs-1ab2cd4392b4a8bb2944cd4df13aa78007b0a4a8.tar.gz emacs-1ab2cd4392b4a8bb2944cd4df13aa78007b0a4a8.zip | |
(gif_load): Fix bug: Handle nonexistent colormap.
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 15 |
1 files changed, 8 insertions, 7 deletions
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); |