diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-05-05 17:58:33 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-05-05 17:58:33 +0200 |
commit | 3d81ce6e34e6216b4ec67deee50aab60097a52b0 (patch) | |
tree | 8af21fa7901a925941ee22ef67aa1b9dcce79328 /source | |
parent | 71d036f72b1c7fad22f326a93e4fe087edfcc7aa (diff) | |
download | mupdf-3d81ce6e34e6216b4ec67deee50aab60097a52b0.tar.xz |
epub: Ignore syntax errors in HTML tag style attributes.
Diffstat (limited to 'source')
-rw-r--r-- | source/html/css-apply.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c index d78d82ee..fbccac8d 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -603,16 +603,23 @@ fz_match_css(fz_context *ctx, fz_css_match *match, fz_css_rule *css, fz_xml *nod s = fz_xml_att(node, "style"); if (s) { - head = tail = prop = fz_parse_css_properties(ctx, s); - while (prop) + fz_try(ctx) { - add_property(match, prop->name, prop->value, INLINE_SPECIFICITY); - tail = prop; - prop = prop->next; + head = tail = prop = fz_parse_css_properties(ctx, s); + while (prop) + { + add_property(match, prop->name, prop->value, INLINE_SPECIFICITY); + tail = prop; + prop = prop->next; + } + if (tail) + tail->next = css->garbage; + css->garbage = head; + } + fz_catch(ctx) + { + fz_warn(ctx, "ignoring style attribute"); } - if (tail) - tail->next = css->garbage; - css->garbage = head; } } |