From 09102fb1e86172ccbd352b650c5d9ed0509a5599 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Tue, 24 May 2022 12:25:47 +1000 Subject: [PATCH] Tweak std/bzip2 decoder.flush_fast applicability --- release/c/wuffs-unsupported-snapshot.c | 2 +- std/bzip2/decode_flush_fast.wuffs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 45e29677..c8f12bc7 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -25966,7 +25966,7 @@ wuffs_bzip2__decoder__flush_fast( v_flush_prev = self->private_impl.f_flush_prev; v_block_checksum_have = self->private_impl.f_block_checksum_have; v_block_size = self->private_impl.f_block_size; - while ((v_block_size > 0) && (((uint64_t)(io2_a_dst - iop_a_dst)) > 255)) { + while ((v_block_size > 0) && (((uint64_t)(io2_a_dst - iop_a_dst)) >= 255)) { if (v_flush_repeat_count < 4) { v_entry = self->private_data.f_bwt[v_flush_pointer]; v_curr = ((uint8_t)((v_entry & 255))); diff --git a/std/bzip2/decode_flush_fast.wuffs b/std/bzip2/decode_flush_fast.wuffs index c8fe0efc..9d472a22 100644 --- a/std/bzip2/decode_flush_fast.wuffs +++ b/std/bzip2/decode_flush_fast.wuffs @@ -28,7 +28,7 @@ pri func decoder.flush_fast!(dst: base.io_writer) { block_checksum_have = this.block_checksum_have block_size = this.block_size - while (block_size > 0) and (args.dst.length() > 255) { + while (block_size > 0) and (args.dst.length() >= 255) { if flush_repeat_count < 4 { entry = this.bwt[flush_pointer] curr = (entry & 0xFF) as base.u8