summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@heap.zone>2016-05-29 16:48:10 +0200
committerJonathan Schleifer <js@heap.zone>2016-05-29 16:48:10 +0200
commit1758b3056434fb57c358ec5b94e1ded6025bb0e3 (patch)
tree7248c7ab7ed0dcc1a813b08a8f0dbe8013bfcd14
parent30160f4ca1ba8d1fb754405d7b81986fbe2af1d3 (diff)
OFInflate64Stream: Fix window size0.8
-rw-r--r--src/OFInflateStream.m23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/OFInflateStream.m b/src/OFInflateStream.m
index 5ca01f18..a984d9b6 100644
--- a/src/OFInflateStream.m
+++ b/src/OFInflateStream.m
@@ -284,18 +284,11 @@ releaseTree(struct huffman_tree *tree)
return [[[self alloc] initWithStream: stream] autorelease];
}
-- init
-{
- OF_INVALID_INIT_METHOD
-}
-
- initWithStream: (OFStream*)stream
{
- self = [super init];
+ self = [self init];
_stream = [stream retain];
- _bitIndex = 8; /* 0-7 address the bit, 8 means fetch next byte */
- _slidingWindowMask = 0x7FFF;
return self;
}
@@ -308,6 +301,20 @@ releaseTree(struct huffman_tree *tree)
}
#endif
+- init
+{
+ self = [super init];
+
+ _bitIndex = 8; /* 0-7 address the bit, 8 means fetch next byte */
+#ifdef DEFLATE64
+ _slidingWindowMask = 0xFFFF;
+#else
+ _slidingWindowMask = 0x7FFF;
+#endif
+
+ return self;
+}
+
- (size_t)lowlevelReadIntoBuffer: (void*)buffer_
length: (size_t)length
{