inflate: fix missing byte read for compression type in gzip deflater

This commit is contained in:
K. Lange 2020-05-05 00:07:02 +09:00
parent 3a130854e7
commit 1c0e741c99

View File

@ -429,6 +429,9 @@ int gzip_decompress(struct inflate_context * ctx) {
if (ctx->get_input(ctx) != 0x1F) return 1;
if (ctx->get_input(ctx) != 0x8B) return 1;
unsigned int cm = ctx->get_input(ctx);
if (cm != 8) return 1;
unsigned int flags = ctx->get_input(ctx);
/* Read mtime */
@ -465,7 +468,7 @@ int gzip_decompress(struct inflate_context * ctx) {
}
(void)crc16;
deflate_decompress(ctx);
int status = deflate_decompress(ctx);
/* Read CRC and decompressed size from end of input */
unsigned int crc32 = read_32le(ctx);
@ -474,5 +477,5 @@ int gzip_decompress(struct inflate_context * ctx) {
(void)crc32;
(void)dsize;
return 0;
return status;
}