Note that the len2 argument of crc_combine*() must be non-negative.

If it is negative, then the code will enter an infinite loop.
diff --git a/zlib.h b/zlib.h
index b3e19fc..39991a4 100644
--- a/zlib.h
+++ b/zlib.h
@@ -1758,14 +1758,14 @@
    seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
    calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
    check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
-   len2.
+   len2. len2 must be non-negative.
 */
 
 /*
 ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
 
      Return the operator corresponding to length len2, to be used with
-   crc32_combine_op().
+   crc32_combine_op(). len2 must be non-negative.
 */
 
 ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);