mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
AZW3 Output: Do not error out if the input document contains embedded fonts of less than 1040 bytes. Fixes #1052892 (conversion error - epub to azw3 - bytearray index out of range)
This commit is contained in:
parent
c294de86e0
commit
060836c133
@ -481,7 +481,7 @@ def write_font_record(data, obfuscate=True, compress=True):
|
||||
if compress:
|
||||
flags |= 0b1
|
||||
data = zlib.compress(data, 9)
|
||||
if obfuscate:
|
||||
if obfuscate and len(data) >= 1040:
|
||||
flags |= 0b10
|
||||
xor_key = os.urandom(key_len)
|
||||
key = bytearray(xor_key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user