X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/8f664e7e91c918cd13248f6b684580c4dd2cdb31..2901c406fda763902b1e77263ec273187f7dc75b:/deflate.c diff --git a/deflate.c b/deflate.c index a04f86d..5bb3cce 100644 --- a/deflate.c +++ b/deflate.c @@ -2441,7 +2441,7 @@ int deflate_decompress_data(deflate_decompress_ctx *dctx, */ if (dctx->nbits < 16) goto finished; - nlen = 0xFFFF & ~dctx->bits; + nlen = dctx->bits & 0xFFFF; EATBITS(16); if (dctx->uncomplen != (nlen ^ 0xFFFF)) { error = DEFLATE_ERR_UNCOMP_HDR;