Future proof the mobi header reader

This commit is contained in:
Kovid Goyal 2013-05-16 13:03:37 +05:30
parent d62343e411
commit 31d77b94da

View File

@ -183,7 +183,7 @@ class BookHeader(object):
self.codec)) self.codec))
# Some KF8 files have header length == 264 (generated by kindlegen # Some KF8 files have header length == 264 (generated by kindlegen
# 2.9?). See https://bugs.launchpad.net/bugs/1179144 # 2.9?). See https://bugs.launchpad.net/bugs/1179144
max_header_length = 0x108 max_header_length = 500 # We choose 500 for future versions of kindlegen
if (ident == 'TEXTREAD' or self.length < 0xE4 or if (ident == 'TEXTREAD' or self.length < 0xE4 or
self.length > max_header_length or self.length > max_header_length or