From 07230e3f964f1558073d52fba9e4eb3e826a7998 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Jul 2011 01:06:29 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/mobi/debug.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/debug.py b/src/calibre/ebooks/mobi/debug.py index 5b0ecf6f8e..790c8dd45b 100644 --- a/src/calibre/ebooks/mobi/debug.py +++ b/src/calibre/ebooks/mobi/debug.py @@ -709,6 +709,7 @@ class IndexRecord(object): # {{{ def __init__(self, record, index_header, cncx): self.record = record raw = self.record.raw + if raw[:4] != b'INDX': raise ValueError('Invalid Primary Index Record') @@ -742,7 +743,7 @@ class IndexRecord(object): # {{{ next_off = len(indxt) index, consumed = decode_hex_number(indxt[off:]) entry_type = ord(indxt[off+consumed]) - d = 1 + d, flags = 1, 0 if index_header.index_type == 6: flags = ord(indxt[off+consumed+d]) d += 1