Change MOBI parsing to hopefully support more MOBI files

This commit is contained in:
Kovid Goyal 2008-12-17 14:46:59 -08:00
parent c46c23a2b2
commit 565dc2821f

View File

@ -101,7 +101,7 @@ class BookHeader(object):
if ident == 'TEXTREAD' or self.length < 0xE4 or 0xE8 < self.length: if ident == 'TEXTREAD' or self.length < 0xE4 or 0xE8 < self.length:
self.extra_flags = 0 self.extra_flags = 0
else: else:
self.extra_flags, = struct.unpack('>L', raw[0xF0:0xF4]) self.extra_flags, = struct.unpack('>H', raw[0xF2:0xF4])
if self.compression_type == 'DH': if self.compression_type == 'DH':
self.huff_offset, self.huff_number = struct.unpack('>LL', raw[0x70:0x78]) self.huff_offset, self.huff_number = struct.unpack('>LL', raw[0x70:0x78])