From 7d1f42d204433ab7585d16202592b8f4d8d9e4eb Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Tue, 14 Jul 2020 14:26:18 +1200 Subject: gif: Fix bug where the local colormap is not dropped. This was seen in a GIF file that had a local colormap set on frame 6, but not on frame 7. Instead of reverting to the global colormap we continued to render with the last local colormap. This was a regression introduced in 4e7b5345d2fc8f0d1dee93d8ba9ab805bc95d42f. Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/156 --- gdk-pixbuf/io-gif.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c index 38ec03d7b..2a7afd049 100644 --- a/gdk-pixbuf/io-gif.c +++ b/gdk-pixbuf/io-gif.c @@ -112,7 +112,6 @@ struct _GifContext unsigned int global_color_resolution; unsigned int background_index; - gboolean frame_cmap_active; CMap frame_color_map; gint frame_colormap_size; unsigned int frame_bit_pixel; @@ -234,7 +233,6 @@ gif_set_get_colormap (GifContext *context) static void gif_set_get_colormap2 (GifContext *context) { - context->frame_colormap_size = 0; context->state = GIF_GET_COLORMAP2; } @@ -696,6 +694,7 @@ gif_get_frame_info (GifContext *context) context->gif89.disposal, context->gif89.delay_time, context->gif89.transparent, context->frame_interlace); #endif + context->frame_colormap_size = 0; if (BitSet (buf[8], LOCALCOLORMAP)) { #ifdef DUMP_IMAGE_DETAILS @@ -707,7 +706,6 @@ gif_get_frame_info (GifContext *context) * of an animated gif. */ /* if it does, we need to re-read in the colormap, * the gray_scale, and the bit_pixel */ - context->frame_cmap_active = TRUE; context->frame_bit_pixel = 1 << ((buf[8] & 0x07) + 1); gif_set_get_colormap2 (context); return 0; -- cgit v1.2.1