Commit c2fbe423465e1fa02a7e681f6b4aaee877e3de03

Vicent Martí 2011-10-24T14:43:18

Merge pull request #464 from rtyley/development Tolerate zlib deflation with window size < 32Kb

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 80f0aa9..dbfe18b 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -214,7 +214,7 @@ static int is_zlib_compressed_data(unsigned char *data)
 	unsigned int w;
 
 	w = ((unsigned int)(data[0]) << 8) + data[1];
-	return data[0] == 0x78 && !(w % 31);
+	return (data[0] & 0x8F) == 0x08 && !(w % 31);
 }
 
 static int inflate_buffer(void *in, size_t inlen, void *out, size_t outlen)