From: Pavel Charvat Date: Sat, 16 Sep 2006 07:43:01 +0000 (+0200) Subject: fixed division by zero X-Git-Tag: holmes-import~549 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=997428ff8a6985721fc904ba83ec162c6cae9fbd;p=libucw.git fixed division by zero --- diff --git a/images/sig-init.c b/images/sig-init.c index 3422c745..c04c4691 100644 --- a/images/sig-init.c +++ b/images/sig-init.c @@ -193,7 +193,7 @@ image_sig_finish(struct image_sig_data *data, struct image_signature *sig) /* For each region */ u64 w_total = 0; uns w_border = MIN(data->cols, data->rows) * image_sig_border_size; - int w_mul = image_sig_border_bonus * 256 / w_border; + int w_mul = w_border ? image_sig_border_bonus * 256 / w_border : 0; for (uns i = 0; i < sig->len; i++) { struct image_sig_region *r = data->regions + i;