drm: add control node checks missing from kms merge
[firefly-linux-kernel-4.4.55.git] / lib / decompress_inflate.c
index 163e66aea5f6a249b04510bf486a40d94e35289d..839a329b4fc43e5d6e40ce912fdfe3ed6bfc4834 100644 (file)
@@ -41,7 +41,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
        set_error_fn(error_fn);
        rc = -1;
        if (flush) {
-               out_len = 0x8100; /* 32 K */
+               out_len = 0x8000; /* 32 K */
                out_buf = malloc(out_len);
        } else {
                out_len = 0x7fffffff; /* no limit */
@@ -97,7 +97,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
                        strm->next_in++;
                strm->next_in++;
        }
-       strm->avail_in = len - 10;
+       strm->avail_in = len - (strm->next_in - zbuf);
 
        strm->next_out = out_buf;
        strm->avail_out = out_len;