From 8c828b6ebbd9e9cee65e8fec1b9e938e18b8e015 Mon Sep 17 00:00:00 2001 From: Kunal Pai Date: Thu, 22 Oct 2026 16:57:30 -0700 Subject: [PATCH] fix(ffi): compress an out-of-range btype as a dynamic block, as C does C's ZopfliDeflatePart sends every btype other than 0 and 1 down the dynamic path and writes a block. deflate_helper matched 0, 1 and 2 and returned for anything else, writing nothing. --- rust/src/ffi.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/src/ffi.rs b/rust/src/ffi.rs index 8121698..717c146 100644 --- a/rust/src/ffi.rs +++ b/rust/src/ffi.rs @@ -485,8 +485,7 @@ unsafe fn deflate_helper( let block_type = match btype { 0 => BlockType::Uncompressed, 1 => BlockType::FixedTree, - 2 => BlockType::DynamicTree, - _ => return, + _ => BlockType::DynamicTree, }; // SAFETY: Input slice validity guaranteed by caller safety contract.