Index: src/OFLHAArchive.m ================================================================== --- src/OFLHAArchive.m +++ src/OFLHAArchive.m @@ -173,10 +173,23 @@ char header[21]; size_t headerLen; if (_mode != modeRead) @throw [OFInvalidArgumentException exception]; + + if (_currentEntry != nil && _lastReturnedStream == nil) { + /* + * No read stream was created since the last call to + * -[nextEntry]. Create it so that we can properly skip the + * data. + */ + void *pool = objc_autoreleasePoolPush(); + + [self streamForReadingCurrentEntry]; + + objc_autoreleasePoolPop(pool); + } [_currentEntry release]; _currentEntry = nil; [(OFLHAArchiveFileReadStream *)_lastReturnedStream of_skip]; @@ -200,11 +213,11 @@ headerLen += [_stream readIntoBuffer: header + headerLen length: 21 - headerLen]; } - _currentEntry= [[OFLHAArchiveEntry alloc] + _currentEntry = [[OFLHAArchiveEntry alloc] of_initWithHeader: header stream: _stream encoding: _encoding]; return _currentEntry;