The state handler in the original inflate.c references the flush parameter to inflate() where it modifies the exit behavior based on this condition:
case TYPE:
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
/* fallthrough */
case TYPEDO:
Now, this case is already correctly implemented in zlib-rs, but since the state handler has been moved out of inflate(), it must reference state.flush, which is never assigned.
The state handler in the original inflate.c references the
flush
parameter toinflate()
where it modifies the exit behavior based on this condition:Now, this case is already correctly implemented in zlib-rs, but since the state handler has been moved out of
inflate()
, it must referencestate.flush
, which is never assigned.I made a PR to address this and get
FLUSH_BLOCK
working properly. https://github.com/memorysafety/zlib-rs/pull/113