diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-10-05 18:53:11 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-10-05 20:09:32 +0100 |
commit | 87524fa1662578401c4fb21108bd6984afee7ce0 (patch) | |
tree | e3f71ae49d89e1cfea7fd1d9e68e8b46b62df3d6 | |
parent | 9be02aade41637fc530774cf2f598a8f69f53bd0 (diff) | |
download | mupdf-87524fa1662578401c4fb21108bd6984afee7ce0.tar.xz |
Bug 697177: Avoid SEGV in Epub file.
Thanks to Vlad Glagolev for the example file, analysis and
patch.
We had failed to initialise the "last break class" value, so that
when we use it as an index into an array, we run the risk of
crashing.
The fix is simply to initialise it. By initialising it to OP
we don't allow any softbreaks to be added when it's uninitialised,
which feels right to me.
-rw-r--r-- | source/html/html-layout.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c index 2211ea4f..8b74caa0 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -2289,6 +2289,7 @@ fz_parse_html(fz_context *ctx, fz_html_font_set *set, fz_archive *zip, const cha g.base_uri = base_uri; g.at_bol = 0; g.emit_white = 0; + g.last_brk_cls = UCDN_LINEBREAK_CLASS_OP; xml = fz_parse_xml(ctx, buf->data, buf->len, 1); |