MOBI Input: Ignore another form of corruption in trailing bytes. Fixes #2023943 [Private bug](https://bugs.launchpad.net/calibre/+bug/2023943)

This commit is contained in:
Kovid Goyal 2023-06-15 08:06:15 +05:30
parent 98f9263f80
commit 1e249c2d47
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -788,7 +788,10 @@ class MobiReader:
flags >>= 1
if self.book_header.extra_flags & 1:
off = size - num - 1
num += (ord(data[off:off+1]) & 0x3) + 1
try:
num += (ord(data[off:off+1]) & 0x3) + 1
except TypeError:
num += 1
return num
def warn_about_trailing_entry_corruption(self):