mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
MOBI metadata: Handle cover/thumbnail exth fields with null pointers
MOBI metadata: Do not fail to set metadata in MOBI files if they have EXTH fields with NULL pointers to a cover or thumbnail. Fixes #1205757 [Metadata edits not sticking](https://bugs.launchpad.net/calibre/+bug/1205757)
This commit is contained in:
parent
694dfe5dc2
commit
7f3b6c1f7d
@ -169,10 +169,11 @@ class MetadataUpdater(object):
|
||||
self.timestamp = content
|
||||
elif id == 201:
|
||||
rindex, = self.cover_rindex, = unpack('>I', content)
|
||||
self.cover_record = self.record(rindex + image_base)
|
||||
if rindex != 0xffffffff:
|
||||
self.cover_record = self.record(rindex + image_base)
|
||||
elif id == 202:
|
||||
rindex, = self.thumbnail_rindex, = unpack('>I', content)
|
||||
if rindex > 0 :
|
||||
if rindex > 0 and rindex != 0xffffffff:
|
||||
self.thumbnail_record = self.record(rindex + image_base)
|
||||
|
||||
def patch(self, off, new_record0):
|
||||
|
Loading…
x
Reference in New Issue
Block a user