]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Cast distance code to uint64_t before shifting in zng_emit_dist.
authorNathan Moinvaziri <nathan@nathanm.com>
Tue, 2 Jun 2020 16:02:07 +0000 (09:02 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 8 Jun 2020 19:13:01 +0000 (21:13 +0200)
trees_emit.h

index 30613f70816f1ef839507a39203b13af059393d6..4cb17db85cc9dcfb52bc97fde68d2c95591d5030 100644 (file)
@@ -144,7 +144,7 @@ static inline uint32_t zng_emit_dist(deflate_state *s, const ct_data *ltree, con
     send_code_trace(s, code);
 
     /* Send the distance code */
-    match_bits |= (dtree[code].Code << match_bits_len);
+    match_bits |= ((uint64_t)dtree[code].Code << match_bits_len);
     match_bits_len += dtree[code].Len;
     extra = extra_dbits[code];
     if (extra != 0) {