From c26dd436697439cf2191d7ab74bde2cbfe601b4f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 3 Nov 2013 21:52:01 +0000 Subject: ensure no division by zero in scaled object dimensioning (coverity 1109864 ) --- render/layout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3