summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2013-11-03 21:52:01 +0000
committerVincent Sanders <vince@kyllikki.org>2013-11-03 21:52:01 +0000
commitc26dd436697439cf2191d7ab74bde2cbfe601b4f (patch)
treed06aab737344c2f9da3b00aa652f8cbb50e60354 /render
parent41bda017d1c8e596c6ed7e7ec4b065c494e46fa1 (diff)
downloadnetsurf-c26dd436697439cf2191d7ab74bde2cbfe601b4f.tar.gz
netsurf-c26dd436697439cf2191d7ab74bde2cbfe601b4f.tar.bz2
ensure no division by zero in scaled object dimensioning (coverity 1109864 )
Diffstat (limited to 'render')
-rw-r--r--render/layout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/render/layout.c b/render/layout.c
index 9827cda28..9bd1156ab 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1059,9 +1059,10 @@ void layout_get_object_dimensions(struct box *box, int *width, int *height,
scaled = true;
}
- if (scaled)
+ if (scaled && (intrinsic_width != 0)) {
*height = (*width * intrinsic_height) /
intrinsic_width;
+ }
} else if (*width == AUTO) {
/* Have given height; width is calculated from the given height