render: Fix pathological case where column minimum width exceeds maximum.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 25 Nov 2018 18:04:40 +0000 (10:04 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 26 Nov 2018 01:16:46 +0000 (17:16 -0800)
src/output/render.c

index 11830a3e8e4125addea848732be02f9fb65fe89a..19244a14b8fd13e670f513cb19a9e04fd6af0923 100644 (file)
@@ -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),