From: Michihiro NAKAJIMA Date: Mon, 27 Feb 2012 09:04:09 +0000 (+0900) Subject: Fix the error which Clang Static Analyzer says "Division by zero". X-Git-Tag: v3.0.4~2^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c856771e2aa8633d8ce664633c4bf74f0377c8b;p=thirdparty%2Flibarchive.git Fix the error which Clang Static Analyzer says "Division by zero". --- diff --git a/libarchive/archive_write_add_filter_compress.c b/libarchive/archive_write_add_filter_compress.c index 84c6db23c..4923316f5 100644 --- a/libarchive/archive_write_add_filter_compress.c +++ b/libarchive/archive_write_add_filter_compress.c @@ -396,7 +396,7 @@ archive_compressor_compress_write(struct archive_write_filter *f, state->checkpoint = state->in_count + CHECK_GAP; - if (state->in_count <= 0x007fffff) + if (state->in_count <= 0x007fffff && state->out_count != 0) ratio = (int)(state->in_count * 256 / state->out_count); else if ((ratio = (int)(state->out_count / 256)) == 0) ratio = 0x7fffffff;