mirror of
https://github.com/google/brotli.git
synced 2026-09-22 14:45:51 +00:00
Inconsistent range of lgwin values #47
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ericlaw1979 on GitHub (Oct 2, 2015).
In the Python version, the allowed range of the Window is 16 to 24:
PyErr_SetString(BrotliError, "Invalid lgwin. Range is 16 to 24.");params.add_argument('--lgwin', metavar="LGWIN", type=int, choices=list(range(16, 25)), help='Base 2 logarithm of the sliding window size. Range is ' '16 to 24. Defaults to 22.')But elsewhere, we see a different limit:
// Base 2 logarithm of the sliding window size. Range is 10 to 24. int lgwin;if (*lgwin < 10 || *lgwin >= 25) { goto error;Is this expected?
@anthrotype commented on GitHub (Oct 2, 2015):
yes, it was changed with
6511d6b016the python extension needs to be updated accordingly.
thanks for spotting it!
@anthrotype commented on GitHub (Oct 6, 2015):
However, the latest draft of Brotli specification still says
16 to 24though:https://github.com/google/brotli/blob/master/docs/draft-alakuijala-brotli-06.txt#L267
Could anyone confirm, before I send the patch, that for
--lgwinthe allowed range needs to be changed from the current[16..24]to[10..24], like it says inenc/encode.hfile, as per commit 6511d6b01629631ad76864fe499a27f36d448396?Thanks.
/cc @szabadka
@szabadka commented on GitHub (Oct 6, 2015):
Thanks a lot for catching this, apparently we forgot to update the introduction part of the spec. I will do that shortly.
@anthrotype commented on GitHub (Oct 6, 2015):
thanks to
grep;)