]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix bug in inflateSync() for data held in bit buffer.
authorMark Adler <madler@alumni.caltech.edu>
Mon, 29 Jan 2024 03:26:17 +0000 (19:26 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 7 Feb 2024 18:15:56 +0000 (19:15 +0100)
madler/zlib#5af7cef45eeef86ddf6ab00b4e363c1eecaf47b6

inflate.c

index 37104e6e6302d098e6e6ae9bfde07726d6ed28c8..0b86cc1dd0d92c2c121c4d9565a4e950fa6559be 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -1269,7 +1269,7 @@ int32_t Z_EXPORT PREFIX(inflateSync)(PREFIX3(stream) *strm) {
     /* if first time, start search in bit buffer */
     if (state->mode != SYNC) {
         state->mode = SYNC;
-        state->hold <<= state->bits & 7;
+        state->hold >>= state->bits & 7;
         state->bits -= state->bits & 7;
         len = 0;
         while (state->bits >= 8) {