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

Decoder miscalculates compression ratio #38

Open
dtikhonov opened this issue Mar 31, 2021 · 0 comments
Open

Decoder miscalculates compression ratio #38

dtikhonov opened this issue Mar 31, 2021 · 0 comments

Comments

@dtikhonov
Copy link
Collaborator

In the function header_out_write_value(), the counter qpd_bytes_out is updated after dhi_process_header() is called, instead of before:

        r = dec->qpd_dh_if->dhi_process_header(read_ctx->hbrc_hblock, xhdr);
        if (r == 0)
            dec->qpd_bytes_out += xhdr->name_len + xhdr->val_len;

The problem here is that the user callback is free to modify xhdr in any manner, potentially making name_len and val_len invalid.

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

No branches or pull requests

1 participant