Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about isa-l inflate read_in_length when state->block_state = ISAL_BLOCK_CODED. #251

Open
ZhaiMo15 opened this issue Jul 27, 2023 · 1 comment
Labels

Comments

@ZhaiMo15
Copy link

ZhaiMo15 commented Jul 27, 2023

As far as I know, read_in_length > 0 only occurs when inflator reads past the eob and into the GZIP trailer, thus need to do

state->next_in -= state->read_in_length / 8;
state->avail_in += state->read_in_length / 8;
state->read_in_length = 0;
state->read_in = 0;

to make pointer correct. In this case, state->block_state is either ISAL_BLOCK_INPUT_DONE or ISAL_BLOCK_FINISH.

However, I noticed that read_in_length may greater than 0 when state->block_state = ISAL_BLOCK_CODED, I wondered why this would happen?

Moreover, let's see a example below.
I print some information before and after one isal_inflate.

Before: inputLen: 2969, avail_in: 2969, outputLen: 4096, avail_out: 4096, read_in: 0x2dc607ff, read_in_length: 32, total_out: 32768, block_state: 3
After : inputLen: 2969, avail_in: 2965, outputLen: 4096, avail_out: 0, read_in: 0x1007a044e2dc60, read_in_length: 52, total_out: 36864, block_state: 4

I have 2 questions,

  1. How does this inflating only read 4 bytes(2969-2965)? Does this related to read_in_length(which is 32)?
  2. If I want to recover the GZIP trailer correctly, should I use 52 or 20(52-32) as "read_in_length" in state->next_in -= state->read_in_length / 8;?
@ZhaiMo15
Copy link
Author

Any ideas? @rhpvorderman @gbtucker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants