From 6a603b5b55262c443bf780f3c112a586cb3d9901 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Nov 2014 13:49:33 +0100 Subject: html: Fix line breaking bugs resulting in infinite loops. --- source/html/layout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/html/layout.c') diff --git a/source/html/layout.c b/source/html/layout.c index f2a8582c..4f778cc5 100644 --- a/source/html/layout.c +++ b/source/html/layout.c @@ -265,7 +265,7 @@ static void measure_word(fz_context *ctx, struct flow *node, float em) static float measure_line(struct flow *node, struct flow *end) { float h = 0; - while (node) + while (node != end) { if (node->h > h) h = node->h; @@ -381,6 +381,7 @@ static void layout_flow(fz_context *ctx, struct box *box, struct box *top, float box->h += avail; layout_line(ctx, indent, top->w, line_w, align, line_start, line_end, box); box->h += line_h; + word_start = find_next_word(line_end, &glue_w); line_start = word_start; line_end = NULL; indent = 0; -- cgit v1.2.3