Skip to content

Commit acfeb7d

Browse files
author
H. Peter Anvin (Intel)
committed
zlib: pass 15 not 0 to inflateInit2()
The convention of passing 0 to inflateInit2() to autodetect the window size is not supported in really old versions of zlib. The only downside with simply passing in the maximum value (15) is potential additional memory buffer allocations, but it is a drop in the bucket for NASM. Fixes: #165 Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
1 parent 94923e1 commit acfeb7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asm/uncompress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ char *uncompress_stdmac(macros_t *sm)
4040
zs.zalloc = nasm_z_alloc;
4141
zs.zfree = nasm_z_free;
4242

43-
if (inflateInit2(&zs, 0) != Z_OK)
43+
if (inflateInit2(&zs, 15) != Z_OK)
4444
panic();
4545

4646
if (inflate(&zs, Z_FINISH) != Z_STREAM_END)

0 commit comments

Comments
 (0)