]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix UBSAN implicit conversion warning in inftrees.c.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Wed, 15 Apr 2026 11:39:54 +0000 (13:39 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 16 Apr 2026 18:05:26 +0000 (20:05 +0200)
Co-authored-by: Nathan Moin Vaziri <nathan@nathanm.com>
inftrees.c

index 1320eb988a2f1e9cdce195e2bd94dd0e11d16d73..d65e6a9ce5d9af52d0d48938b2ab3b1033b68ddd 100644 (file)
@@ -342,7 +342,7 @@ int Z_INTERNAL zng_inflate_table(codetype type, uint16_t *lens, unsigned codes,
         } while (fill != 0);
 
         /* backwards increment the len-bit code huff */
-        rhuff += (0x8000u >> (len - 1));
+        rhuff = (uint16_t)(rhuff + (0x8000u >> (len - 1)));
         huff = zng_bitreverse16(rhuff);
 
         /* go to next symbol, update count, len */