summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2018-04-02 20:23:30 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2018-04-02 20:23:30 +0100
commit473a40bc114d70d84610d40b425cf1e9bc548359 (patch)
tree2ab3f89129d8a4099b700e9e51bad0c14c41294f /render/layout.c
parentaf554fcedf8a3c209350ccb1acfd5b233081bd18 (diff)
downloadnetsurf-473a40bc114d70d84610d40b425cf1e9bc548359.tar.gz
netsurf-473a40bc114d70d84610d40b425cf1e9bc548359.tar.bz2
Layout: Fix min max pass calc that looked wrong.
The `width` variable call be set to AUTO, which is INT_MIN, so we can't add it to max without checking it's > 0, or we'll blunder into the minmax assertions.
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/render/layout.c b/render/layout.c
index 59fa0c905..b1d5557bd 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -836,7 +836,8 @@ layout_minmax_line(struct box *first,
if (min < width)
min = width;
- max += width;
+ if (width > 0)
+ max += width;
*line_has_height = true;
}