aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-03-03 18:55:22 +0100
committerLoïc Hoguin <[email protected]>2015-03-03 23:16:44 +0100
commit7d82a632f4837764ac79dfb4986d102060bd3080 (patch)
tree050bd036fba730bdf99a0e9e96fb227ae704c283 /erts/preloaded/src
parent5f08be20308db9680c9d7e1f01242cedd84a2b4e (diff)
downloadotp-7d82a632f4837764ac79dfb4986d102060bd3080.tar.gz
otp-7d82a632f4837764ac79dfb4986d102060bd3080.tar.bz2
otp-7d82a632f4837764ac79dfb4986d102060bd3080.zip
Update zlib:zwindowbits/0 type to accept 8 and -8
Commit 7e8f5a776cbfa376e03369d058a90c8dd9f217fc (importing R11B-3) updated zlib, which had changed what values it accepts for window bits from 9-15 to 8-15. From deflate.c: - windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_HUFFMAN_ONLY) { + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } + if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ In inflate.c 8 was already an accepted value. This commit updates OTP to also accept the values 8 and -8.
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/zlib.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/preloaded/src/zlib.erl b/erts/preloaded/src/zlib.erl
index df7b2e6198..988d837e3a 100644
--- a/erts/preloaded/src/zlib.erl
+++ b/erts/preloaded/src/zlib.erl
@@ -124,7 +124,7 @@
-type zlevel() :: 'none' | 'default' | 'best_compression' | 'best_speed'
| 0..9.
-type zmethod() :: 'deflated'.
--type zwindowbits() :: -15..-9 | 9..47.
+-type zwindowbits() :: -15..-8 | 8..47.
-type zmemlevel() :: 1..9.
-type zstrategy() :: 'default' | 'filtered' | 'huffman_only' | 'rle'.
@@ -496,8 +496,8 @@ arg_method(_) -> erlang:error(badarg).
-spec arg_bitsz(zwindowbits()) -> zwindowbits().
arg_bitsz(Bits) when is_integer(Bits) andalso
- ((8 < Bits andalso Bits < 48) orelse
- (-15 =< Bits andalso Bits < -8)) ->
+ ((8 =< Bits andalso Bits < 48) orelse
+ (-15 =< Bits andalso Bits =< -8)) ->
Bits;
arg_bitsz(_) -> erlang:error(badarg).