summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2020-07-14 14:26:18 +1200
committerEmmanuele Bassi <ebassi@gmail.com>2020-11-09 12:44:19 +0000
commit7d1f42d204433ab7585d16202592b8f4d8d9e4eb (patch)
tree99f12ef6acea66886ffc308155777cb80d7eec53 /gdk-pixbuf
parent67615b575a683a7e28387dda65ae8976ac999290 (diff)
downloadgdk-pixbuf-7d1f42d204433ab7585d16202592b8f4d8d9e4eb.tar.gz
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
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-gif.c4
1 files changed, 1 insertions, 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;