Ahem. Don't invert the length _twice_.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 3 May 2012 17:40:08 +0000 (17:40 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 3 May 2012 17:40:08 +0000 (17:40 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/halibut@9476 cda61777-01e9-0310-a592-d414129be87e

deflate.c

index a04f86d..5bb3cce 100644 (file)
--- 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;