MOBI Input: Fix regression caused by KF8 support that broke reading on ancient PRC files from Baen

This commit is contained in:
Kovid Goyal 2012-03-18 13:23:16 +05:30
parent 43cf8faebc
commit 9712175d74

View File

@ -186,7 +186,7 @@ class BookHeader(object):
if len(raw) >= 0xF8:
self.ncxidx, = struct.unpack_from(b'>L', raw, 0xF4)
if self.mobi_version >= 8:
if self.mobi_version == 8 and len(raw) >= (0xF8 + 16):
self.dividx, self.skelidx, self.datpidx, self.othidx = \
struct.unpack_from(b'>4L', raw, 0xF8)