From 4776f05430e1b8002e6ca6eec3e69f84fa130eda Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 25 Oct 2013 22:06:29 +0100 Subject: fix potential division by zero by only computing width and height when content is valid and hence will return content width and height not zero. coverity 110986[23] --- render/html_object.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'render/html_object.c') diff --git a/render/html_object.c b/render/html_object.c index f7ed3bd94..e66667b14 100644 --- a/render/html_object.c +++ b/render/html_object.c @@ -293,10 +293,12 @@ html_object_callback(hlcache_handle *object, } else { /* Non-background case */ - int w = content_get_width(object); - int h = content_get_height(object); if (hlcache_handle_get_content(object) == event->data.redraw.object) { + + int w = content_get_width(object); + int h = content_get_height(object); + data.redraw.x = data.redraw.x * box->width / w; data.redraw.y = data.redraw.y * -- cgit v1.2.3