summaryrefslogtreecommitdiff
path: root/src/select/computed.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-20 09:43:22 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-20 09:43:22 +0000
commit7e761a5a56554e00a89794a63872dbd9f8623a5a (patch)
treef5c3ac0cd5efe289b607dd8cea0c284d0b8de445 /src/select/computed.c
parent80d60c52a54c3ccba04b4d3ef05bf70582872cc9 (diff)
downloadlibcss-7e761a5a56554e00a89794a63872dbd9f8623a5a.tar.gz
libcss-7e761a5a56554e00a89794a63872dbd9f8623a5a.tar.bz2
Avoid division by zero
svn path=/trunk/libcss/; revision=8624
Diffstat (limited to 'src/select/computed.c')
-rw-r--r--src/select/computed.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index 4b44f56..8881d2c 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -289,8 +289,11 @@ css_error compute_absolute_values(const css_computed_style *parent,
return error;
/* Convert ex size into ems */
- ex_size.data.length.value = FDIV(ex_size.data.length.value,
- size.data.length.value);
+ if (size.data.length.value != 0)
+ ex_size.data.length.value = FDIV(ex_size.data.length.value,
+ size.data.length.value);
+ else
+ ex_size.data.length.value = 0;
ex_size.data.length.unit = CSS_UNIT_EM;
/* Fix up background-position */