From 4e5149c53389133b2ef0c751f1684691fcdeb5d8 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 25 Nov 2018 10:04:40 -0800 Subject: [PATCH] render: Fix pathological case where column minimum width exceeds maximum. --- src/output/render.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/output/render.c b/src/output/render.c index 11830a3e8e..19244a14b8 100644 --- a/src/output/render.c +++ b/src/output/render.c @@ -784,6 +784,13 @@ render_page_create (const struct render_params *params, struct table *table) table_cell_free (&cell); } + /* In pathological cases, spans can cause the minimum width of a column to + exceed the maximum width. This bollixes our interpolation algorithm + later, so fix it up. */ + for (i = 0; i < nc; i++) + if (columns[MIN][i].width > columns[MAX][i].width) + columns[MAX][i].width = columns[MIN][i].width; + /* Decide final column widths. */ for (i = 0; i < 2; i++) table_widths[i] = calculate_table_width (table_nc (table), -- 2.30.2