MOBI Input: Handle MOBI files that have too large number of records fields in their headers. Fixes #740713 (IndexError: list index out of range)

This commit is contained in:
Kovid Goyal 2011-03-22 23:17:18 -06:00
parent 1b112a31e1
commit 0c9a5a8356

View File

@ -769,7 +769,8 @@ class MobiReader(object):
def extract_text(self): def extract_text(self):
self.log.debug('Extracting text...') self.log.debug('Extracting text...')
text_sections = [self.text_section(i) for i in range(1, self.book_header.records + 1)] text_sections = [self.text_section(i) for i in range(1,
min(self.book_header.records + 1, len(self.sections)))]
processed_records = list(range(0, self.book_header.records + 1)) processed_records = list(range(0, self.book_header.records + 1))
self.mobi_html = '' self.mobi_html = ''