summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-05-05 20:28:36 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-05-05 20:55:53 +0200
commita3422a76d10fb82edb5a1a50edd9024280c31ef6 (patch)
tree63e9d0234cbc8448b5a2bf0fcf28a439de8c2771 /source/html
parent2b3bd1b7dbbf13f82b70587676809f189354c77a (diff)
downloadmupdf-a3422a76d10fb82edb5a1a50edd9024280c31ef6.tar.xz
epub: Ignore missing stylesheet files.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/html-layout.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 6e9655db..39163c00 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -1008,6 +1008,8 @@ html_load_css(fz_context *ctx, fz_archive *zip, const char *base_uri, fz_css_rul
fz_buffer *buf;
char path[2048];
+ fz_var(buf);
+
for (node = root; node; node = fz_xml_next(node))
{
const char *tag = fz_xml_tag(node);
@@ -1028,13 +1030,17 @@ html_load_css(fz_context *ctx, fz_archive *zip, const char *base_uri, fz_css_rul
fz_urldecode(path);
fz_cleanname(path);
- buf = fz_read_archive_entry(ctx, zip, path);
- fz_write_buffer_byte(ctx, buf, 0);
+ buf = NULL;
fz_try(ctx)
+ {
+ buf = fz_read_archive_entry(ctx, zip, path);
+ fz_write_buffer_byte(ctx, buf, 0);
css = fz_parse_css(ctx, css, (char*)buf->data, path);
+ }
+ fz_always(ctx)
+ fz_drop_buffer(ctx, buf);
fz_catch(ctx)
fz_warn(ctx, "ignoring stylesheet %s", path);
- fz_drop_buffer(ctx, buf);
}
}
}