diff --git a/release/c/wuffs-unsupported-snapshot.h b/release/c/wuffs-unsupported-snapshot.h index d56987f3..eb914668 100644 --- a/release/c/wuffs-unsupported-snapshot.h +++ b/release/c/wuffs-unsupported-snapshot.h @@ -6535,12 +6535,6 @@ wuffs_gif__decoder__decode_frame_config(wuffs_gif__decoder* self, WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(4); } } - if ((self->private_impl.f_local_palette_log2_size != 0) || - self->private_impl.f_gc_has_transparent_index) { - self->private_impl.f_which_palette = 1; - } else { - self->private_impl.f_which_palette = 0; - } v_blend = 0; if (!self->private_impl.f_gc_has_transparent_index) { v_blend = 2; @@ -7992,6 +7986,12 @@ wuffs_gif__decoder__decode_id_part1(wuffs_gif__decoder* self, (4 * ((uint32_t)(self->private_impl.f_gc_transparent_index))) + 3)] = 0; } + if ((self->private_impl.f_local_palette_log2_size != 0) || + self->private_impl.f_gc_has_transparent_index) { + self->private_impl.f_which_palette = 1; + } else { + self->private_impl.f_which_palette = 0; + } wuffs_base__pixel_buffer__set_palette( a_dst, ((wuffs_base__slice_u8){ .ptr = self->private_impl diff --git a/std/gif/decode_gif.wuffs b/std/gif/decode_gif.wuffs index 34d4d174..6d7bef31 100644 --- a/std/gif/decode_gif.wuffs +++ b/std/gif/decode_gif.wuffs @@ -187,12 +187,6 @@ pub func decoder.decode_frame_config!??(dst nptr base.frame_config, src base.io_ } } - if (this.local_palette_log2_size != 0) or this.gc_has_transparent_index { - this.which_palette = 1 - } else { - this.which_palette = 0 - } - var blend base.u8 = 0 if not this.gc_has_transparent_index { blend = 2 // 2 is WUFFS_BASE__ANIMATION_BLEND__OPAQUE. @@ -551,6 +545,12 @@ pri func decoder.decode_id_part1!??(dst ptr base.pixel_buffer, src base.io_reade this.palettes[1][(4 * (this.gc_transparent_index as base.u32)) + 2] = 0x00 this.palettes[1][(4 * (this.gc_transparent_index as base.u32)) + 3] = 0x00 } + + if (this.local_palette_log2_size != 0) or this.gc_has_transparent_index { + this.which_palette = 1 + } else { + this.which_palette = 0 + } args.dst.set_palette!(palette:this.palettes[this.which_palette][:]) // Other GIF implementations accept GIF files that aren't completely spec