@@ -291,7 +291,7 @@ int32_t Z_EXPORT PREFIX(inflatePrime)(PREFIX3(stream) *strm, int32_t bits, int32
291291 if (bits > 16 || state -> bits + (unsigned int )bits > 32 )
292292 return Z_STREAM_ERROR ;
293293 value &= (1L << bits ) - 1 ;
294- state -> hold += (unsigned )value << state -> bits ;
294+ state -> hold += (uint64_t )value << state -> bits ;
295295 state -> bits += (unsigned int )bits ;
296296 return Z_OK ;
297297}
@@ -387,7 +387,7 @@ static void updatewindow(PREFIX3(stream) *strm, const uint8_t *end, uint32_t len
387387 do { \
388388 if (have == 0) goto inf_leave; \
389389 have--; \
390- hold += ((unsigned )(*next++) << bits); \
390+ hold += ((uint64_t )(*next++) << bits); \
391391 bits += 8; \
392392 } while (0)
393393
@@ -479,7 +479,7 @@ int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
479479 unsigned char * put ; /* next output */
480480 unsigned char * from ; /* where to copy match bytes from */
481481 unsigned have , left ; /* available input and output */
482- uint32_t hold ; /* bit buffer */
482+ uint64_t hold ; /* bit buffer */
483483 unsigned bits ; /* bits in bit buffer */
484484 uint32_t in , out ; /* save starting available input and output */
485485 unsigned copy ; /* number of stored or match bytes to copy */
@@ -577,7 +577,7 @@ int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
577577 case TIME :
578578 NEEDBITS (32 );
579579 if (state -> head != NULL )
580- state -> head -> time = hold ;
580+ state -> head -> time = ( unsigned )( hold ) ;
581581 if ((state -> flags & 0x0200 ) && (state -> wrap & 4 ))
582582 CRC4 (state -> check , hold );
583583 INITBITS ();
@@ -704,7 +704,7 @@ int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
704704#endif
705705 case DICTID :
706706 NEEDBITS (32 );
707- strm -> adler = state -> check = ZSWAP32 (hold );
707+ strm -> adler = state -> check = ZSWAP32 (( unsigned ) hold );
708708 INITBITS ();
709709 state -> mode = DICT ;
710710 Z_FALLTHROUGH ;
@@ -1128,7 +1128,7 @@ int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
11281128#ifdef GUNZIP
11291129 state -> flags ? hold :
11301130#endif
1131- ZSWAP32 (hold )) != state -> check ) {
1131+ ZSWAP32 (( unsigned ) hold )) != state -> check ) {
11321132 SET_BAD ("incorrect data check" );
11331133 break ;
11341134 }
0 commit comments