mate-desktop / atril

A document viewer for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
197 stars 62 forks source link

epub: add fallback for malformed epub files in check_mime_type #571

Closed rbuj closed 1 year ago

rbuj commented 1 year ago

fix #325

lukefromdc commented 1 year ago

A rebase of this against current master opened the previously referrred to test file from the issue, though being malformed internal elements of it beyond the picture were not found. They were not found with just trusting the file extension either, and that's potentially less safe, so that's the fault of the file, not this effort to get partially usable epub files to open.

Another test file https://github.com/IDPF/epub3-samples/releases/download/20170606/cc-shared-culture.epub from the older segfault issue fixed by another PR opened fine with this applied.