mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Prevent ImageMagick crash in identify when debugging MOBI6 files
This commit is contained in:
parent
8d52fc6fd9
commit
157a2a3a69
@ -17,7 +17,7 @@ from calibre.ebooks.mobi.reader.index import (parse_index_record,
|
|||||||
parse_tagx_section)
|
parse_tagx_section)
|
||||||
from calibre.ebooks.mobi.utils import (decode_hex_number, decint,
|
from calibre.ebooks.mobi.utils import (decode_hex_number, decint,
|
||||||
decode_tbs, read_font_record)
|
decode_tbs, read_font_record)
|
||||||
from calibre.utils.magick.draw import identify_data
|
from calibre.utils.imghdr import what
|
||||||
from calibre.ebooks.mobi.debug import format_bytes
|
from calibre.ebooks.mobi.debug import format_bytes
|
||||||
from calibre.ebooks.mobi.debug.headers import TextRecord
|
from calibre.ebooks.mobi.debug.headers import TextRecord
|
||||||
|
|
||||||
@ -763,7 +763,7 @@ class MOBIFile(object): # {{{
|
|||||||
b'\xe9\x8e\r\n', b'RESC', b'BOUN', b'FDST', b'DATP',
|
b'\xe9\x8e\r\n', b'RESC', b'BOUN', b'FDST', b'DATP',
|
||||||
b'AUDI', b'VIDE', b'FONT'}:
|
b'AUDI', b'VIDE', b'FONT'}:
|
||||||
try:
|
try:
|
||||||
width, height, fmt = identify_data(r.raw)
|
fmt = what(None, r.raw)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if fmt is not None:
|
if fmt is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user