mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
ensure no division by zero can occour (coverity 1109862 1109863)
This commit is contained in:
parent
c26dd43669
commit
aa4d2eb608
@ -299,15 +299,24 @@ html_object_callback(hlcache_handle *object,
|
||||
int w = content_get_width(object);
|
||||
int h = content_get_height(object);
|
||||
|
||||
data.redraw.x = data.redraw.x *
|
||||
if (w != 0) {
|
||||
data.redraw.x =
|
||||
data.redraw.x *
|
||||
box->width / w;
|
||||
data.redraw.y = data.redraw.y *
|
||||
data.redraw.width =
|
||||
data.redraw.width *
|
||||
box->width / w;
|
||||
}
|
||||
|
||||
if (h != 0) {
|
||||
data.redraw.y =
|
||||
data.redraw.y *
|
||||
box->height / h;
|
||||
data.redraw.width = data.redraw.width *
|
||||
box->width / w;
|
||||
data.redraw.height =
|
||||
data.redraw.height =
|
||||
data.redraw.height *
|
||||
box->height / h;
|
||||
}
|
||||
|
||||
data.redraw.object_width = box->width;
|
||||
data.redraw.object_height = box->height;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user